Preventing Multiple Button Click on Asp.net Page
Disabling a button until processing is completeHere's the scenario - let's say you have an Insert subroutine, called 'doInsert'. You want to immediately disable the Submit button, so that the end-user won't click it multiple times, therefore, submitting the same data multiple times.
For this, use a regular HTML button, including a Runat="server" and an 'OnServerClick' event designation - like this:
<INPUT id="Button1" onclick="document.form1.Button1.disabled=true;" type="button" value="Submit - Insert Data" name="Button1" runat="server" onserverclick="doInsert">
Then, in the very last line of the 'doInsert' subroutine, add this line:
Button1.enabled="True"
2 comments:
how do i call the .asp page from .aspx page.
You can find update of this article on http://dotnetguts.blogspot.com/2008/05/disable-multiple-button-click-in-aspnet.html
Post a Comment