Add a Submit Button Confirmation to an ASP.NET Web Form

April 07, 2008

I've been asked many times how to add a confirmation dialog for a simple (or complex, why not?) ASP.NET web form. It's simple:

  • Find the OnClientClick property of the button control
  • Type return confirm('are you sure?') as the value of the property

Profile picture

Written by Edin Kapić Insatiably curious code-writing tinkerer. Geek father. Aviation enthusiast. Cuisine journeyman. Follow me on Twitter