A common task when you develop web applications is to avoid double clicking on buttons, the user may send two or more times the form content and sometimes you may have unexpected results like double payments and other nasty effects.
Here is the code snippet used to avoid this behavior, btnSendResults is the ASP.NET buttons that causes the postback event, use in the Page_Load event:
Hope it helps!btnSendResults.Attributes.Add("onclick", "this.disabled=true;" + ClientScript.GetPostBackEventReference(btnSendResults, "")+";return false;");
No comments:
Post a Comment