how to design confirm message box, like Javascript Confirm box, in ASP.NET??
if the user click "YES" in the confirm box, i need to do something, else do
other things. Do I need to have javascript confirm box or ASP.NET has such
feature??
Million thanks. 7 3092
"Grey" <er*******@i-cable.com> wrote in message
news:e2**************@TK2MSFTNGP09.phx.gbl... how to design confirm message box, like Javascript Confirm box, in ASP.NET?? if the user click "YES" in the confirm box, i need to do something, else do other things. Do I need to have javascript confirm box or ASP.NET has such feature??
For client-side user interaction, use JavaScript.
for example:
create a button: button1
Page_Load():
this.Button1.Attributes.Add("onclick","javascript : if(confirm('No to
cancel?')== false) return false;");
if "Cancel" button pressed, this page will not post back.
"Grey" wrote: how to design confirm message box, like Javascript Confirm box, in ASP.NET?? if the user click "YES" in the confirm box, i need to do something, else do other things. Do I need to have javascript confirm box or ASP.NET has such feature??
Million thanks.
Just to add to this.
You can ONLY cancel the post back with javascript like this, you cannot
branch and "do other things".
Greg
"Handi" <Ha***@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com... for example: create a button: button1 Page_Load(): this.Button1.Attributes.Add("onclick","javascript: if(confirm('No to cancel?')== false) return false;");
if "Cancel" button pressed, this page will not post back.
"Grey" wrote:
how to design confirm message box, like Javascript Confirm box, in ASP.NET?? if the user click "YES" in the confirm box, i need to do something, else do other things. Do I need to have javascript confirm box or ASP.NET has such feature??
Million thanks.
"Handi" <Ha***@discussions.microsoft.com> wrote in message news:2A**********************************@microsof t.com... for example: create a button: button1 Page_Load(): this.Button1.Attributes.Add("onclick","javascript: if(confirm('No to cancel?')== false) return false;");
if "Cancel" button pressed, this page will not post back.
Just a note: don't change the javascript to the seemingly identical but shorter
return confirm('No to cancel?')
because .Net can add it's own javascript to that onclick handler. This shorter
version would prevent the execution of that code! This is also why you *need*
the closing ";" to separate your code from the additional code.
By the way, you don't need to specify "javascript:" for an onclick handler.
Hans Kesting
"Grey" wrote:
how to design confirm message box, like Javascript Confirm box, in ASP.NET?? if the user click "YES" in the confirm box, i need to do something, else do other things. Do I need to have javascript confirm box or ASP.NET has such feature??
Million thanks.
I've never seen that recomendation before. Is it related to the classic
"validator ate my onclick event" problem?
one example of problem: http://tinyurl.com/6bkvw
Greg Just a note: don't change the javascript to the seemingly identical but shorter return confirm('No to cancel?') because .Net can add it's own javascript to that onclick handler. This shorter version would prevent the execution of that code! This is also why you *need* the closing ";" to separate your code from the additional code.
By the way, you don't need to specify "javascript:" for an onclick handler.
Hans Kesting
Is it possible to have button text as Yes/No instead of OK/Cancel ??
"Greg Burns" wrote: I've never seen that recomendation before. Is it related to the classic "validator ate my onclick event" problem?
one example of problem: http://tinyurl.com/6bkvw
Greg
Just a note: don't change the javascript to the seemingly identical but shorter return confirm('No to cancel?') because .Net can add it's own javascript to that onclick handler. This shorter version would prevent the execution of that code! This is also why you *need* the closing ";" to separate your code from the additional code.
By the way, you don't need to specify "javascript:" for an onclick handler.
Hans Kesting
AFAIK, not with a javascript confirm. Maybe using vbscript msgbox...?
Greg
"Lee" <Le*@discussions.microsoft.com> wrote in message
news:90**********************************@microsof t.com... Is it possible to have button text as Yes/No instead of OK/Cancel ??
"Greg Burns" wrote:
I've never seen that recomendation before. Is it related to the classic "validator ate my onclick event" problem?
one example of problem: http://tinyurl.com/6bkvw
Greg
> Just a note: don't change the javascript to the seemingly identical but > shorter > return confirm('No to cancel?') > because .Net can add it's own javascript to that onclick handler. This > shorter > version would prevent the execution of that code! This is also why you > *need* > the closing ";" to separate your code from the additional code. > > By the way, you don't need to specify "javascript:" for an onclick > handler. > > Hans Kesting This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: dmiller23462 |
last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript
but my end result is I need two text boxes to stay hidden until a
particular option is selected....I've cobbled together the...
|
by: LRW |
last post by:
Having a problem getting a onSubmit function to work, to where it popsup a
confirmation depending on which radiobutton is selected.
Here's what I have:
function checkdel() {
if...
|
by: JohnSouth104 |
last post by:
Hi
I want to warn the user that changing the selected item in a pull-down
will clear some data he has already entered in a file download box.
I've tried using confirm() to return true or false...
|
by: @sh |
last post by:
Can anyone help out here please, we have a button that when pressed will
alert the user, should they cancel no action is taken, however should they
confirm, the script will disable the button and...
|
by: Remco Groot Beumer |
last post by:
Hello,
I've developed a Microsoft Access 2000 database. In a lot of events
Docmd.RunSQL is used. In my database options the 'Confirm' options are
turned off, so I don't have to confirm action...
|
by: Bob Sanderson |
last post by:
I am trying to create a form for a MySQL database similar to a spreadsheet.
The idea is to display a list of records, with the last line of the list
being an input form. When the user enters data...
|
by: cir9 |
last post by:
I know that I can add: return confirm(Are you sure?') to a
button and have the button eventhandler action taken if they choose
yes, but is there any good way to also cause a postback and...
|
by: Tomislav |
last post by:
Hello,
I need a method to create Dialog box in PHP to confirm an action like
for instance, sending an e-mail, so if "OK" is clicked action is
performed and if "Cancel" is clicked action is...
|
by: GiJeet |
last post by:
Hello, I'm trying to figure this code out.
<input type="submit" onclick="if(!confirm('Are you sure?') return
false; "... />
I know that if you return false in an event like this onclick it...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |