How to pop up a confirmation dialog box?

  • Thread starter Thread starter Amelyan
  • Start date Start date
A

Amelyan

What is the common way in ASP.NET C# to pop up a confirmation dialog box?
E.g.

Are you sure you want to delete this item?
Yes No
 
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.
 
Back
Top