简体   繁体   English

使按钮忽略ENTER键按下c#

[英]Make Button Ignore ENTER key pressed c#

im building a page using ASP.NET, however, the first element of my page is a Button and there are other elements below it, however, if the client types something and it shows a confirmation box, and he presses ENTER key, it activates the first button at the page. 我使用ASP.NET构建页面,但是,页面的第一个元素是Button,下面还有其他元素,但是,如果客户端键入内容并显示确认框,然后按ENTER键,它将激活页面上的第一个按钮。

I tried to change the tab order does not work. 我试图更改选项卡顺序不起作用。

sorry for noob question xD 对不起,菜鸟问题xD

Don't handle the click event. 不要处理click事件。 Handle the MouseClick event instead. 而是处理MouseClick事件。 So whatever code is in click, simply move to the MouseClick event 因此,无论单击什么代码,只需移至MouseClick事件

您是否尝试过在第一个按钮上设置UseSubmitBehavior = False

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM