【问题标题】:how to get the focus to a button on pressing the "enter" key in the key board如何在按键盘中的“输入”键时将焦点移到按钮上
【发布时间】:2010-05-24 09:46:26
【问题描述】:

我有一个带有两个按钮的 aspx 页面,“关闭”和“提交”按钮。当我按下键盘上的 Enter 键时,焦点会自动转到“关闭”按钮并关闭页面。相反,我希望将焦点移到按下键盘上的 Enter 键时,将注意力集中在“提交”按钮上。

【问题讨论】:

    标签: asp.net button setfocus


    【解决方案1】:

    在你的框架上设置 defaultbutton 属性:

    <form id="form1" runat="server" defaultbutton="btnID">
    

    http://forums.asp.net/t/985791.aspx

    【讨论】:

      猜你喜欢
      • 2020-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-02
      • 2017-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多