ASP.NET中如何让文本框的值只能大于或小于一个特定的数
1个回答
2013-08-31
展开全部
用RangeValidator验证控件给个小例子,你试试<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ErrorMessage="输入错误" ControlToValidate="TextBox1" Display="Dynamic"
MaximumValue="100" MinimumValue="0"></asp:RangeValidator>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ErrorMessage="输入错误" ControlToValidate="TextBox1" Display="Dynamic"
MaximumValue="100" MinimumValue="0"></asp:RangeValidator>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询