首页 > Web开发 > 详细

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

时间:2019-09-23 15:59:33      阅读:142      评论:0      收藏:0      [点我收藏+]
/// <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);
        }

 

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

原文:https://www.cnblogs.com/nanfei/p/11571915.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!