在asp.net中防止按钮多次点击提交的办法!
在asp.net中防止按钮多次点击提交的办法!
为提交button 加上下面的属性:
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("if (typeof(Page_ClientValidate) == 'function') { ");
sb.Append("if (Page_ClientValidate() == false) { return false; }} ");
sb.AppendFormat("this.value = '{0}';", this.waitText);
sb.Append("this.disabled = true;");
sb.Append(this.Page.GetPostBackEventReference(this));
sb.Append(";");
this.Attributes["onclick"] = sb.ToString();
"this.value='Please wait...';this.disabled = true;"
+ this.GetPostBackEventReference(this.Button1));
浙公网安备 33010602011771号