How to disable submit behaviour of asp:ImageButton?

前端 未结 8 1859
小蘑菇
小蘑菇 2020-12-02 00:12

I have a image button in a page which can be triggered on mouse click, by default it gets triggered on enter press also which i want to disable.

I know about \"UseSu

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 00:24

    The form will execute the first button it finds on the page when you hit enter. If you can move the ImageButton further down the page so it's no longer the first button in the markup, and use CSS to position it properly, this should fix your issue. I fixed the same exact thing last week and this worked for me. I went with this solution because it didn't require JavaScript to work properly.

提交回复
热议问题