简体   繁体   中英

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.

I tried to change the tab order does not work.

sorry for noob question xD

Don't handle the click event. Handle the MouseClick event instead. So whatever code is in click, simply move to the MouseClick event

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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