System.Web.UI.WebControls Namespace
Serves as the abstract base class for validation controls that perform typed comparisons.
Visibility |
Name |
Parameters |
Return Type |
protected |
AddAttributesToRender |
(
HtmlTextWriter
writer
)
|
Void
|
public static |
CanConvert |
(
String
text
,
ValidationDataType
type
,
Boolean
cultureInvariant
)
|
Boolean
|
public static |
CanConvert |
(
String
text
,
ValidationDataType
type
)
|
Boolean
|
protected static |
Compare |
(
String
leftText
,
String
rightText
,
ValidationCompareOperator
op
,
ValidationDataType
type
)
|
Boolean
|
protected static |
Compare |
(
String
leftText
,
Boolean
cultureInvariantLeftText
,
String
rightText
,
Boolean
cultureInvariantRightText
,
ValidationCompareOperator
op
,
ValidationDataType
type
)
|
Boolean
|
protected static |
Convert |
(
String
text
,
ValidationDataType
type
,
Boolean
cultureInvariant
,
Object&
value
)
|
Boolean
|
protected static |
Convert |
(
String
text
,
ValidationDataType
type
,
Object&
value
)
|
Boolean
|
protected |
DetermineRenderUplevel |
( )
|
Boolean
|
protected static |
GetDateElementOrder |
( )
|
String
|
protected static |
GetFullYear |
(
Int32
shortYear
)
|
Int32
|
|
The BaseCompareValidator class is inherited by validation controls that compare values, such as the CompareValidator and RangeValidator controls.
Use the Type property to specify the data type that the values are converted to before being compared.
NOTE: If the value of the input control associated with the validation control cannot be converted to the specified data type, validation fails. The IsValid property of the validation control is set to false.
The BaseCompareValidator class also contains several static properties and methods that are useful when performing comparison validations. You can determine whether a string can be converted to a specific data type by using the CanConvert method. The maximum year that can be represented by a two digit year is contained in the CutoffYear property. The GetFullYear method allows you to convert a two digit year to a four digit year.
For additional information on validation controls, see BaseValidator.
BaseValidator CompareValidator RangeValidator Type Validating Against a Data Type