ASP.NET: checking a text field contains an integer greater than zero?

If I want to check that the text field contains an integer greater than or equal to zero. Do I need to use TWO asp: CompareValidator: one with the DataTypeCheck operator and one with the GreaterThanEqual operator? A.

Or data type operator redundancy? Is it possible to use only one validator with the GreaterThanEqual operator (and the type set in Integer)?

+6
validation textbox
source share
1 answer

That 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"/> 
+14
source share

All Articles