Quick Tip: How to use OnClick and OnClientClick events to Prevent Double Clicking on your ASP.Net Buttons

Sup-a-Dillie-O

Quick Tip

While ASP.Net provides an excellent validator set of controls, sometimes you need to “roll your own” so to speak when creating your controls. In addition, if you have some AJAX processing with your buttons behind the scenes (for example, saving a record in a popup window) you run the risk of having “double saves” occurring when the user clicks on the button and nothing happens immediately.

Having struggled with this issue myself lately, it took a little more work than anticipated to get this to work properly. Here’s how you get everything to play nicely together.

View original post 658 more words

Advertisements

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s