当前位置: 代码迷 >> ASP.NET >> js调服务器按钮事件 为什么执行了俩次,该如何处理
  详细解决方案

js调服务器按钮事件 为什么执行了俩次,该如何处理

热度:4001   发布时间:2013-02-25 00:00:00.0
js调服务器按钮事件 为什么执行了俩次
<asp:textbox id="txtKey" onkeydown="if(event.keyCode==13){document.all.Button4.focus();document.all.Button4.click();}" runat="server" BorderStyle="Groove" Width="128px" MaxLength="13"></asp:textbox>

为什么断点跟踪 txtkey的回车 会掉俩次Button4事件?

------解决方案--------------------------------------------------------
执行了两次post.
------解决方案--------------------------------------------------------
把document.all.Button4.focus();去掉试试
  相关解决方案