Method 1:
The code copy is as follows:
<script type="text/javascript" event="onkeydown" for="document">
if(event.keyCode==13)
{
var button=document.all("<%=ButtonAddorUpdate.ClientID %>");
button.focus();
button.click();
}
</script>
Method 2:
The code copy is as follows:
<input type="button" onclick="noClick()" style="margin-top:-1024px;" id="noUseButton" />
<script type="text/javascript" event="onkeydown" for="document">
if(event.keyCode==13)
{
var button=document.getElementById("noUseButton");
button.focus();
button.onclick();
}
</script>
<script>
function noClick()
{
return false;
}
</script>
Note: Make the user unable to see the control
1: Hide attributes
2: Put it outside the interface
Method 3:
Block page carriage return event
Add the following content to the Form ID:
The code copy is as follows:
method="post" onkeydown="if(event.keyCode==13) return false;"