I need a asp.net text box validation to enter value which is above zero;
Not less than zero or zero
You can set up a CompareValidator with those conditions.
Add a RequiredFiedlValidator if you don't want it to be left empty.
The aspx looks like this:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="Must be > 0"
Operator="GreaterThan" Type="Integer"
ValueToCompare="0" />
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