<asp:TextBox ID="TextBox1" runat="server" onkeydown = "return (event.keyCode!=13);" > </asp:TextBox>
如果密钥是回车键,这将返回false,这将取消表单提交.