TrialUser
asked on
Disable a button from the user clicking it twice
I have button in my form. I want the user to not be able to double click it or click it twice.
<asp:Button ID="Button6" runat="server" Text="Cancel" CssClass="cancelclass" />
I need the code behind server side code to be executed on the button click, but at the same time not allow the user to click the button again. please help
<asp:Button ID="Button6" runat="server" Text="Cancel" CssClass="cancelclass" />
I need the code behind server side code to be executed on the button click, but at the same time not allow the user to click the button again. please help
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
A dirty way is to use inline asp.net tags in markup
var old_WebForm_OnSubmit = WebForm_OnSubmit;
WebForm_OnSubmit = function() {
if(old_WebForm_OnSubmit()) {
document.getElementById('<%= <yourButton>.ClientID %>').disabled = true;
}
};
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks