防止ASP.NET按钮多次提交的办法 .
2011-11-02 11:11
501 查看
//方法一:在提交时调用一段客户端的代码。
function a()
{
document.getElementById("btnok").value = '正在提交
![](http://www.cnblogs.com/Images/dot.gif)
';
document.getElementById("btnok").onclick=function(){return false;};
return true;
}
<input
id="btnok" runat="server" type="submit" value="确定" onclick="return
a();"
onserverclick="Submit1_ServerClick" />
//方法二:必需要是Asp.net服务器控件。(注意UseSubmitBehavior属性)
<asp:Button
ID="btnSumbit" runat="server" UseSubmitBehavior="false"
OnClientClick="this.value='正在提交
![](http://www.cnblogs.com/Images/dot.gif)
';this.disabled=true; "
Text="提交" OnClick="btnSumbit_Click" />
function a()
{
document.getElementById("btnok").value = '正在提交
![](http://www.cnblogs.com/Images/dot.gif)
';
document.getElementById("btnok").onclick=function(){return false;};
return true;
}
<input
id="btnok" runat="server" type="submit" value="确定" onclick="return
a();"
onserverclick="Submit1_ServerClick" />
//方法二:必需要是Asp.net服务器控件。(注意UseSubmitBehavior属性)
<asp:Button
ID="btnSumbit" runat="server" UseSubmitBehavior="false"
OnClientClick="this.value='正在提交
![](http://www.cnblogs.com/Images/dot.gif)
';this.disabled=true; "
Text="提交" OnClick="btnSumbit_Click" />
相关文章推荐
- 【转帖】防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法
- 【ASP.NET】防止ASP.NET按钮多次提交的办法
- 【ASP.NET】防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法
- [Asp.Net]防止ASP.NET按钮多次提交的办法
- [Asp.Net]防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法及延伸
- 防止ASP.NET按钮多次提交的办法
- [转帖]【ASP.NET】防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法(很好的。)
- 防止ASP.NET按钮多次提交的办法
- 【ASP.NET】防止ASP.NET按钮多次提交的办法
- 防止ASP.NET按钮多次提交的办法