Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何防止 iframe 中的 aspx 页面导致回发
你可以做到这一点。将按钮分配为面板默认值并通过按钮属性
或 b。用jQuery
<asp:Panel DefaultButton="Button1" /> Button1.UseSubmitBehavior="False"
用jQuery
$(document).keypress(function(e) { if(e.keyCode === 13) { e.preventDefault(); return false; } });