Friday, January 4, 2008

How To Disable a button untill processing is complete

Here'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: < id="Button1" onclick="">=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"

No comments:

Post a Comment