Hello Everyone,
I am trying to prompt the user for something. I don't think that I can use
a message box from ASP.NET. I have tried using VBScript to give the message
box, but I can't figure out how to do something with their response.
Example - They click a button. A message box pops up with OK and Cancel
buttons. If they click OK, then I need to redirect to another page. If
they click Cancel, then nothing needs to happen.
Any advice? Thanks in advance!
--
Chuck Foster
Programmer Analyst
Eclipsys Corporation - St. Vincent Health System 8 5188
We're talking about an HTML document here, don't forget.
JavaScript confirm() method - This is the one you need. It presents the user
with a message and an OK and Cancel button. If the user hits Cancel, it
returns false. If the user hits OK, it returns true.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"chuckdfost er" <ch**********@h otmail.com> wrote in message
news:O%******** ********@TK2MSF TNGP12.phx.gbl. .. Hello Everyone,
I am trying to prompt the user for something. I don't think that I can use a message box from ASP.NET. I have tried using VBScript to give the message box, but I can't figure out how to do something with their response. Example - They click a button. A message box pops up with OK and Cancel buttons. If they click OK, then I need to redirect to another page. If they click Cancel, then nothing needs to happen.
Any advice? Thanks in advance!
-- Chuck Foster Programmer Analyst Eclipsys Corporation - St. Vincent Health System
If you are considering commercial solutions, check out LiveControls for
ASP.NET. You can see a demo of the exact scenario you outlined at http://www.dart.com/livetutorial/dis...LiveMessageBox.
You can display an Alert, Confirm, or Prompt box and when the user
chooses, a server-event is raised.
javascript window.confirm (..) produces a message box with OL and Cancel
buttons. If it returns true, navigate away with window.navigate (..) or in
any other way. Everything on client side.
Eliyahu
"chuckdfost er" <ch**********@h otmail.com> wrote in message
news:O%******** ********@TK2MSF TNGP12.phx.gbl. .. Hello Everyone,
I am trying to prompt the user for something. I don't think that I can
use a message box from ASP.NET. I have tried using VBScript to give the
message box, but I can't figure out how to do something with their response. Example - They click a button. A message box pops up with OK and Cancel buttons. If they click OK, then I need to redirect to another page. If they click Cancel, then nothing needs to happen.
Any advice? Thanks in advance!
-- Chuck Foster Programmer Analyst Eclipsys Corporation - St. Vincent Health System
Thank you! That will work just great! Thanks for all of your help.
"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:eQ******** ********@tk2msf tngp13.phx.gbl. .. javascript window.confirm (..) produces a message box with OL and Cancel buttons. If it returns true, navigate away with window.navigate (..) or in any other way. Everything on client side.
Eliyahu
"chuckdfost er" <ch**********@h otmail.com> wrote in message news:O%******** ********@TK2MSF TNGP12.phx.gbl. .. Hello Everyone,
I am trying to prompt the user for something. I don't think that I can use a message box from ASP.NET. I have tried using VBScript to give the message box, but I can't figure out how to do something with their response. Example - They click a button. A message box pops up with OK and Cancel buttons. If they click OK, then I need to redirect to another page. If they click Cancel, then nothing needs to happen.
Any advice? Thanks in advance!
-- Chuck Foster Programmer Analyst Eclipsys Corporation - St. Vincent Health System
Ok, So I lied. It isn't working quite like I want it to. I need to insert
data into a database if they answer OK. How can I use client-side
(window.confirm ) and server-side (insert into db) together? I tried using
the Response.Write to send the JavaScript, but didn't get very far. Anymore
advice????
Thanks
"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:eQ******** ********@tk2msf tngp13.phx.gbl. .. javascript window.confirm (..) produces a message box with OL and Cancel buttons. If it returns true, navigate away with window.navigate (..) or in any other way. Everything on client side.
Eliyahu
"chuckdfost er" <ch**********@h otmail.com> wrote in message news:O%******** ********@TK2MSF TNGP12.phx.gbl. .. Hello Everyone,
I am trying to prompt the user for something. I don't think that I can use a message box from ASP.NET. I have tried using VBScript to give the message box, but I can't figure out how to do something with their response. Example - They click a button. A message box pops up with OK and Cancel buttons. If they click OK, then I need to redirect to another page. If they click Cancel, then nothing needs to happen.
Any advice? Thanks in advance!
-- Chuck Foster Programmer Analyst Eclipsys Corporation - St. Vincent Health System
This server side VB.NET code outputs javascript to display a confirmation
message.
myDeleteButton. Attributes.Add( "onclick", _
"return confirm('Are you sure you want to delete?');")
In this example, the Delete button will post back only if the person
confirms they want to delete. Otherwise your server code is never called in
response to the button click.
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://SteveOrr.net
"chuckdfost er" <ch**********@h otmail.com> wrote in message
news:O%******** ********@TK2MSF TNGP12.phx.gbl. .. Hello Everyone,
I am trying to prompt the user for something. I don't think that I can use a message box from ASP.NET. I have tried using VBScript to give the message box, but I can't figure out how to do something with their response. Example - They click a button. A message box pops up with OK and Cancel buttons. If they click OK, then I need to redirect to another page. If they click Cancel, then nothing needs to happen.
Any advice? Thanks in advance!
-- Chuck Foster Programmer Analyst Eclipsys Corporation - St. Vincent Health System
Ok, this is something more then just redirecting to another page. On
pressing OK you need to postback to the same page. Just call
myForm.submit() . If you need to pass some extra info, you can use a hidden
<input> or any other standard way.
Eliyahu
"chuckdfost er" <ch**********@h otmail.com> wrote in message
news:eu******** ******@TK2MSFTN GP15.phx.gbl... Ok, So I lied. It isn't working quite like I want it to. I need to
insert data into a database if they answer OK. How can I use client-side (window.confirm ) and server-side (insert into db) together? I tried using the Response.Write to send the JavaScript, but didn't get very far.
Anymore advice????
Thanks
"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message news:eQ******** ********@tk2msf tngp13.phx.gbl. .. javascript window.confirm (..) produces a message box with OL and Cancel buttons. If it returns true, navigate away with window.navigate (..) or
in any other way. Everything on client side.
Eliyahu
"chuckdfost er" <ch**********@h otmail.com> wrote in message news:O%******** ********@TK2MSF TNGP12.phx.gbl. .. Hello Everyone,
I am trying to prompt the user for something. I don't think that I
can use a message box from ASP.NET. I have tried using VBScript to give the message box, but I can't figure out how to do something with their response. Example - They click a button. A message box pops up with OK and
Cancel buttons. If they click OK, then I need to redirect to another page.
If they click Cancel, then nothing needs to happen.
Any advice? Thanks in advance!
-- Chuck Foster Programmer Analyst Eclipsys Corporation - St. Vincent Health System
Ok, that works great for a button. One more question. Can I add attributes
to a check box such as oncheckchanged? I have tried but can't get it to
work. I can get it to work for an "onclick" for a checkbox, but then can't
get any server side code to run.
Thanks for your help. Sorry for the trouble.
"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:ev******** ******@TK2MSFTN GP12.phx.gbl... This server side VB.NET code outputs javascript to display a confirmation message.
myDeleteButton. Attributes.Add( "onclick", _ "return confirm('Are you sure you want to delete?');")
In this example, the Delete button will post back only if the person confirms they want to delete. Otherwise your server code is never called
in response to the button click.
-- I hope this helps, Steve C. Orr, MCSD, MVP http://SteveOrr.net
"chuckdfost er" <ch**********@h otmail.com> wrote in message news:O%******** ********@TK2MSF TNGP12.phx.gbl. .. Hello Everyone,
I am trying to prompt the user for something. I don't think that I can use a message box from ASP.NET. I have tried using VBScript to give the message box, but I can't figure out how to do something with their response. Example - They click a button. A message box pops up with OK and Cancel buttons. If they click OK, then I need to redirect to another page. If they click Cancel, then nothing needs to happen.
Any advice? Thanks in advance!
-- Chuck Foster Programmer Analyst Eclipsys Corporation - St. Vincent Health System
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Hugh Welford |
last post by:
Hi Using WIN XP and FP2000
Using CDO.message to out put a message from my site, I get the following
error message 8004020f from using the code:-
strsql = "SELECT * FROM details WHERE patid = " & request("to") & ";"
objrec.open strsql, objconn, adopenforwardonly, adlockoptimistic, adcmdtext
thetext = "Hello, " & request("nickto") & " you have a new message on online
Connect from " & session("username") & "<br> <a target='_top'
|
by: Brian Keating EI9FXB |
last post by:
Would I be correct in saying that the only way to get a user message into a
Windows form would be to use P/Invoke with Message?
Of is there some part of the .NET API that I am totally un aware of?
Thanks for any help
Brian
|
by: Rod |
last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some
reason, opening some ASP.NET applications we wrote is producing the
following error message:
"The Web server reported the following error when attempting to create or
open the Web project located at the following URL:
'http://localhost/WebApplication1'. 'HTTP/1.1 500 Internal Server Error'."
|
by: Microsoft News |
last post by:
What I have is a message box that pops up. It is another browser window.
The code is a general function that you pass message, title and a key to.
The box works great except, that if you are on a page, get the message box,
then click ok on the message box go to another page and then back to the
first page. The message box pops up again. It is almost like the history
or cache still has information about the state and that it knows that...
|
by: ronscottlangham |
last post by:
I am working on a custom WCF EndpoingBehavior that will modify the
messages coming in and out of my Service. I am having an error
related to the modification of the message in the
IEndpointBehavior.AfterReceiveRequest(ref Message request,...) method.
In the method that creates a new message, I have something similar
to ...
/// xmlReader defined with new modified content....
/// 'message' is the original message...
| |
by: =?Utf-8?B?QWRl?= |
last post by:
HI All,
I am encountering the following error when I try to send an email through a
SMTP server. I believe the problem lies with the authentication part when the
network crednetials are used, error is thrown at the .send point.
Error is:
The following error occured Sending an email: System.ApplicationException:
An error occurred sending an email To helen@HerMail.com
From ade@MyMail.com Cc Subject A test with Finlistener #1. The body...
|
by: Steven Allport |
last post by:
I am working on processing eml email message using the email module (python
2.5), on files exported from an Outlook PST file, to extract the composite
parts of the email. In most instances this works fine, the message is read
in using message_from_file, is_multipart returns True and I can process each
component and extract message attachments.
I am however running into problem with email messages that contain emails
forwarded as...
|
by: Philluminati |
last post by:
I have a Perl SOAP Server which returns this SOAP Message when
invoked:
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://
schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/
XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/...
|
by: bernd |
last post by:
Hi netties,
posted this in a different group already, which seems to be
inappropriate.
I create a message queue with msgget(), sent a 5-byte message to it
with msgsnd() and try to receive the queue's content with msgrcv().
Everything seems to work fine, apart from the fact that I get back
only the last byte back from the original message (after sending the
message ipcs -qA shows clearly that there are 5 Bytes waiting in the
|
by: forums_mp |
last post by:
Facing a design problem here and I'm not sure how to solve this. The
system consists of bi-directional communication between a subject
communicating with two (at least for now ) listeners. Message
translation needs to occur during communication. Each message
between subject and listener contains 30 words where each word is
16bits in size. The first word in each message is a header.
Communication between Subject and Listeners can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |