October 2010
Intermediate to advanced
1920 pages
73h 55m
English
RangeValidator ControlThe RangeValidator control enables you to check whether the value of a form field falls between a certain minimum and maximum value. You must set five properties when using this control:
• ControlToValidate—
The ID of the form field validated.
• Text—
The error message displayed when validation fails.
• MinimumValue—
The minimum value of the validation range.
• MaximumValue—
The maximum value of the validation range.
• Type—
The type of comparison to perform. Possible values are String, Integer, Double, Date, and Currency.
For example, the page in Listing 3.9 includes a RangeValidator that validates an age form field. If you do not enter an age between 5 and 100, a validation error displays (see Figure 3.7