在windows2003中,可能iis版本太底,不支持TextBox的类型设为Number类型,所以会报错,所以去掉后直接用验证控件来控制必须输入数字好了。

1 <asp:RegularExpressionValidator   ID="RegularExpressionValidator2" runat="server"   ControlToValidate="txtLearn" 
2                 ErrorMessage="只能输入数字" ForeColor="Red"   ValidationExpression="^[0-9]*$" Display="Dynamic"></asp:RegularExpressionValidator>

用这个自定义验证控件的时候就只能是数字了,但是提示的时候要在后面撑开一个位子来显示提示文字的。

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2022-03-02
  • 2021-07-25
猜你喜欢
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2021-07-23
相关资源
相似解决方案