javascript confirm() before postback events

  • Thread starter Thread starter Adrijan Josic
  • Start date Start date
A

Adrijan Josic

I have a delete asp:button control with an OnClick event.
I would like to ask the user with a javascript confirm()
something like "are you sure you wish to delete this
object" and if he is then do then fire the onclick event
on the server...

How would I do this?
 
MyDeleteButton.Attributes.Add("onClick", "return confirm('Are you sure you
wish to delete this object?')");

Regards,

Mun
 
Back
Top