web form 防止一个请求重复提交

/// <summary>
        /// 防止一个请求重复提交
        /// </summary>
        public void PreventRepeatSubmit()
        {
            if (ScriptManager.GetCurrent(this.Page).IsInAsyncPostBack)
                ScriptManager.RegisterStartupScript(this, this.GetType(), "PreventRepeatSubmit", this.Page.ClientScript.GetPostBackEventReference(this.Page.Form, string.Empty), true);
            else
                Page.ClientScript.RegisterStartupScript(this.GetType(), "PreventRepeatSubmit", this.Page.ClientScript.GetPostBackEventReference(this.Page.Form, string.Empty), true);
        }
原文地址:https://www.cnblogs.com/nanfei/p/11571915.html