System.Web.UI.WebControls Namespace RangeValidator Class
Sets or retrieves the maximum value of the validation range.
Inline |
<asp:rangevalidator maximumvalue = strValue ... > |
Script |
RangeValidator.MaximumValue [ = strValue ] |
strValue |
String specifying the maximum value of the validation range. |
The property is read/write with no default value.
Use the MaximumValue property to specify the maximum value of the validation range. If the value specified by this property fails to convert to the data type specified by the BaseCompareValidator.Type property, an exception is thrown.
NOTE: If you specify Date for the Type property without programmatically setting the culture for the application, you should use a culture-neutral format, such as YYYY/MM/DD, for both the MaximumValue and MinimumValue properties. Otherwise, the date may not be interpreted correctly.
The following shows how to declaratively set the MaximumValue of a RangeValidator at design time.
<asp:rangevalidator id = "rangeChecker"
controltovalidate = "myTextBox"
minimumvalue = "1" maximumvalue = ""10"" type = "Integer"
enableclientscript=false
display = "dynamic" forecolor = "blue" font-bold
text = "The value must be from 1 to 10"
runat = "server" />
Show me
RangeValidator Members MinimumValue Validating Against a Range of Values