Ranges
This lets you see if a value is between two ranges. The
range (set in MinimumValue and MaximumValue can either be a string or number).
This checks to see if a zip code is within a specified range, I also used a
Regular Expression Validator to check it too.
Please Enter your Zip Code:<asp:textbox
id="ZIP" runat="server" /><p> <asp:RangeValidator
runat="server" ControltoValidate="ZIP" ErrorMessage="Your Zip isn't within
the range (8000 - 9000)!" MinimumValue="8000" MaximumValue="9000" />
<asp:RegularExpressionValidator runat="Server"
ControltoValidate="ZIP" ErrorMessage="That Zip code is invalid (numbers
only and 4 numbers long!)" ValidationExpression="[0-9]{4}|[0-9]{5}" /> |
The RangeValidator made sure that you kept the value between
8000 and 9000, the regular expression one made sure that it was 4 or 5
(someone would complain if it was only 4) numbers long and only numbers.