If I want to validate that a text box contains an integer greater than or equal to zero. Do I need to use TWO asp:CompareValidator controls: one with a DataTypeCheck operator and one with a GreaterThanEqual operator?
Or is the datatype operator redundant? Can I just use a single validator with the GreaterThanEqual operator (and the type set to Integer)?
This should be enough
<asp:RangeValidator id="Range1"
ControlToValidate="TextBox1"
MinimumValue="0"
MaximumValue="2147483647"
Type="Integer"
Text="The value must be integer and greater or equal than 0"
runat="server"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With