在Asp.Net2.0中可以通过指定验证控件的 SetFocusOnError 属性,来完成当验证错误时,控件自动得到焦点:

    <asp:RequiredFieldValidator

       SetFocusOnError="true"

       ErrorMessage="Enter something" ControlToValidate="TextBox1"

       runat="server" />

相关文章:

  • 2021-12-30
  • 2022-12-23
  • 2022-02-19
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案