asp.net 禁用按钮防止重复提交

按钮设置

1.OnClientClick属性为”this.disabled=true;“

2.UseSubmitBehavior属性为”false“

举例如下:

<asp:Button ID="BtnTest" runat="server" Text="测试" OnClick="BtnTest_Click" OnClientClick="this.disabled=true;" UseSubmitBehavior="false" />

根据设置为不同属性生成网页,对比其Html即可看出差异。

原文地址:https://www.cnblogs.com/fengxiaoling/p/4070952.html