asp.net防止页面重复提交

解决方法一:

              .Framework2.0中才有的button属性:<asp:button id="btnSubmit" onclick="btnSubmit_Click" runat="server"  OnClientClick="this.disabled=true;this.form.submit();" UseSubmitBehavior="False" /> 

            解决重复提交:OnClientClick="this.disabled=true;this.form.submit();" UseSubmitBehavior="False"

解决方法二:

             this.btnSubmit.Attributes["onclick"] = this.GetPostBackEventReference(this.btnSubmit) + ";this.disabled=true;";     //防止重复提交
posted on 2008-03-10 10:07  千山暮雪  阅读(4070)  评论(3编辑  收藏  举报