RangeValidator: The RangeValidator control is used
to check that the user enters an input value that falls between two values.
·
It
is possible to check ranges within numbers, dates, and characters.
·
The
validation will not fail if the input control is empty. Use the RequiredFieldValidator
control to make the field required.
·
The
validation will not fail if the input value cannot be converted to the data
type specified. Use the CompareValidator control, with its Operator property
set to ValidationCompareOperator.DataTypeCheck, to verify the data type of the
input value.
Property
|
Description
|
MaximumValue
|
Specifies the maximum value of the range
|
MinimumValue
|
Specifies the minimum value of the range
|
Type
|
Specifies the data type of the values to compare. The types are:
·
Currency
·
Date
·
Double
·
Integer
·
String
|
Control
usage:
<asp:TextBox runat="server" ID="txtAge"></asp:TextBox>
<asp:RangeValidator ID="rvAge" runat="server"
ControlToValidate="
txtAge" ErrorMessage="Enter
your age between (18-40)"
MaximumValue="40" MinimumValue="18" Type="Integer">
</asp:RangeValidator>
|
Comments
Post a Comment