SharePoint Dragons

Nikander & Margriet on SharePoint

Monthly Archives: February 2015

Disable ASP.NET button after click

The combination of the properties OnClientClick and UseSubmitBehavior prevent a button from being clicked twice before completed.

The following makes sure the button can’t be clicked twice:


But, this also means the ASP.NET click event won’t happen!!! In order to do so you need to set the following:


Setting this property to true bypasses the client browser’s submit mechanism in favor of the ASP.NET postback mechanism. Setting this leads to the insertion of some client-side script to the page th post the form to the server. Here’s a complete example that can be included in an .aspx page: