SharePoint Dragons

Nikander & Margriet on SharePoint

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:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: