webform 防止一个请求重复提交

/// <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);
        }

 

posted on 2019-09-23 13:53  空明流光  阅读(431)  评论(0编辑  收藏  举报

导航