If you want to disable a button as soon as user click on it
(so they don't click multiple times) , you have to do it on client side. Below is how you can do this.
- Add the button first
<asp:button causesvalidation="false" id="SubmitButton" onclick="SubmitButton_Click" onclientclick="DisableSubmitButton()" runat="server" text="Submit" usesubmitbehavior="false">
- Add this JavaScript function to the page and you set to go.
function DisableSubmitButton(url) {
var button = document.getElementById('<%= SubmitButton.ClientID %>');
button.disabled = true
button.value = 'Submitting...';
__doPostBack('SubmitRadButton', '')
}
No comments:
Post a Comment