On csdn forums, some friends often ask questions about repeated Button clicking. I have also answered many times, but here I will explain the implementation method again to solve the problems of more friends. Due to my limited ability, what's wrong, please kindly advise.
First, add enableeventvalidation = "false" in <% @ Page %> ".
Btnok is the ID of the submit button. Add the callback method to the page_load event. btnok_click is the server to be implemented after submission.Code. The overall implementation process is relatively simple.
// Make the button unavailable and call back server events
Protected Void Page_load ( Object Sender, eventargs E)
... {
This. Btnok. Attributes. Add ("Onclick", Clientscript. getpostbackeventreference (btnok,"Click")+ "; This. Disabled = true; this. value = 'submitting ...';");
}
// Button handling method (51aspx.com)
Protected Void Btnok_click ( Object Sender, eventargs E)
... {
System. Threading. thread. Sleep (2000);
Clientscript. registerstartupscript (GetType (),"Btncommit","Alert ('submission successful !!! ');",True);
}