How to show a confirm dialog?

A

ad

I want user can confirm before delete records ?
How can I show a confirm dialog when users press a button?
 
S

Steve C. Orr [MVP, MCSD]

Here's some server side code that uses 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.

Here's a more detailed analysis of your options, including a free control
that can handle many of the options for you.
http://SteveOrr.net/articles/ClientSideSuite.aspx
 
A

ad

Thank for your immediately answer.
I wnat to show a progress bar dialog after the user press Yes in the confirm
dialog.
The javascript function for Show progress bar dialog is
_ShowProgressWindow();
I do that with the code:
myDeleteButton.Attributes.Add("onclick", "return confirm('Are you sure you
want to delete?');");
myDeleteButton.Attributes.Add("ShowProgressWindow()");
But it fail to show Progress bar!
How can I add two event handle to one event in javascript?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top