我有一个ASP.NET应用程序,其中有几个ASP.NET按钮和几个纯HTML按钮。任何时候有一个用户输入的文本框,ASP.NET按钮尝试提交表单。
我知道我可以更改defaultButton,但我不希望有任何默认按钮。我只是想要它,所以当用户按下进入它不做任何事情。
我已经尝试将defaultButton设置为空白,但这似乎不起作用。按Enter键时如何防止ASP.NET按钮提交表单?
解决方法
您可以设置按钮的UseSubmitBehavior = false
btnCategory.UseSubmitBehavior = false;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。