开发者

Disable default button in ASP.NET [duplicate]

This question already has answers here: Closed 11 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜