Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 ASP.NET Webform 上实现多个默认按钮的最佳方法是什么?
我有一个我认为非常标准的页面。有一个带有用户/密码字段和登录按钮的登录区域。然后在同一页面的其他地方有一个带有搜索按钮的搜索字段。
asp:Panel有一个名为 的属性DefaultButton。您只需要使用适当的面板封装您的标记部分,并为每个面板设置默认按钮。
asp:Panel
DefaultButton
捕获屏幕每个区域的输入键,然后触发相应按钮的点击。
使用像这样的辅助函数将文本框绑定到它们的关联按钮。