RangeValidator accepts empty textbox
Posted on 2009-07-01
I have a textbox that requires the user enter a number into.
In order to make sure they enter something and it is a valid integer I thought a rangevalidator would do the trick where the range is 0 -99999
If they try to enter text or 0.5 then everything works fine but if they have an empty text box or spaces then the form is submitted. Did I miss something?
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="txtHoursLost" ErrorMessage="*Invalid value"
ForeColor="White" MaximumValue="99999" MinimumValue="0" Type="Integer"></asp:RangeValidator>