btnSubmit.Attributes.Add("onclick", "this.disabled=true;" +This will disable the button when the submit button is clicked, and it will automatically enable itself after the page has been postback.
ClientScript.GetPostBackEventReference(btnSubmit, "").ToString());
Note:
1.The ClientScript.GetPostBackEventReference(btnSubmit, "") will generate the __doPostBack('btnSubmit', ''); for the btnSubmit button.
2.If you use the UpdatePanel control, make sure you update the the submit button as well.
3.It is not 100% working for all situations, so be sure to test it before applying on your web application.
No comments:
Post a Comment