日期:2014-05-18  浏览次数:20390 次

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();去掉试试