Disable default button in ASP.NET [duplicate]
Possible Duplicate:
ASP.NET Canceling the Default Submit Button
I have only 1 button in my ASP.NET page 开发者_运维知识库but when I click "Enter" key the button click function is talking place. I don't want that. Only manual click must work. How to make this?
Set the button's UseSubmitBehavior = "false"
<body onkeypress="return CancelReturnKey();">
<script type="text/javascript">
function CancelReturnKey() {
if (window.event.keyCode == 13)
return false;
}
</script>
Please see the links
http://www.bloggingdeveloper.com/post/Disable-Form-Submit-on-Enter-Key-Press.aspx
http://forums.asp.net/t/985791.aspx/1
精彩评论