System.Web 1.0.5000.0 2.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Web.UI.WebControls.BaseValidator

The class is inherited by validation controls that compare values, such as the and controls, to provide basic common functionality.

Use the property to specify the data type that that the values are converted to before being compared.

If the value of the input control being validated cannot be converted to the specified data type, validation fails. The property of the validation control is set to false.

The 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 method. The maximum year that can be represented by a two-digit year is contained in the property. The method allows you to convert a two-digit year to a four-digit year.

When you use validator controls that derive from the control inside an control, make sure that the validator control and the control it is associated with are in the same panel. For more information about using the control for partial-page updates, see Partial-Page Rendering Overview.

For more information about validation controls, see .

## Accessibility

The markup rendered by default for this control might not conform to accessibility standards such as the Web Content Accessibility Guidelines 1.0 (WCAG) priority 1 guidelines. For details about accessibility support for this control, see ASP.NET Controls and Accessibility.

Serves as the abstract base class for validation controls that perform typed comparisons.

- Constructor

  Because the class is abstract, you cannot create a object directly. This constructor is commonly called by the constructor of a derived class to initialize the properties defined in the class.

  Initializes a new instance of the class.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void `` a

  The method is used to render the attributes of the control in the HTML tag for the control. This method is typically overridden by control developers in derived classes to insert the appropriate attributes and styles to the output stream for a control.

  Adds the HTML attributes and styles that need to be rendered for the control to the specified object.

  1.0.5000.0
  2.0.0.0
- Method
  System.Boolean `` ``

  Use the method to determine whether the specified string can be converted to the specified data type. This method is commonly used to test whether a string can be converted to a compatible data type before performing an operation that depends on that data type.

  This version of the method tests the value using the format used by the current culture. To test the value using a culture-neutral format, use the overloaded version of this method.

  Determines whether the specified string can be converted to the specified data type. This version of the overloaded method tests currency, double, and date values using the format used by the current culture.

  true if the specified data string can be converted to the specified data type; otherwise, false.

  The string to test. One of the values. 1.0.5000.0 2.0.0.0
- Method
  2.0.0.0
  System.Boolean `` `` ``

  Use the method to determine whether the specified string can be converted to the specified data type. This method is commonly used to test whether a string can be converted to a compatible data type before performing an operation that depends on that data type. To indicate that values should be tested using a culture-neutral format, pass in true for the parameter; otherwise, values are tested using the format used by the current culture. When testing a value using the format used by the current culture, consider using the overloaded version of this method.

  Determines whether the specified string can be converted to the specified data type. This version of the overloaded method allows you to specify whether values are tested using a culture-neutral format.

  true if the specified data string can be converted to the specified data type; otherwise, false.

  The string to test. One of the enumeration values. true to test values using a culture-neutral format; otherwise, false.
- Method
  System.Boolean `` `` `` `` To be added. To be added.

  The method is used to test whether the value of the parameter relates to the value of the parameter in the manner specified by the parameter. The parameter specifies the data type of the values being compared.

  If the parameter is set to ValidationCompareOperator.DataTypeCheck, this method tests only the value of the parameter for the data type specified by the parameter. The parameter is ignored.

  This version of the method compares the values using the format used by the current culture. To compare the values using a culture-neutral format, use the overloaded version of this method.

  Compares two strings using the specified operator and data type. This version of the overloaded method compares currency, double, and date values using the format used by the current culture.

  true if the parameter relates to the parameter in the manner specified by the parameter; otherwise, false.

  One of the values. One of the values. 1.0.5000.0 2.0.0.0
- Method
  2.0.0.0
  System.Boolean `` `` `` `` `` `` To be added. To be added.

  The method is used to test whether the value of the parameter relates to the value of the parameter in the manner specified by the parameter. The parameter specifies the data type of the values being compared.

  If the parameter is set to ValidationCompareOperator.DataTypeCheck, this method tests only the value of the parameter for the data type specified by the parameter. The parameter is ignored.

  To indicate that values should be compared using a culture-neutral format, pass in true for the and parameters; otherwise, the values are compared using the format used by the current culture. When comparing values using the format used by the current culture, consider using the overloaded version of this method.

  Compares two strings using the specified operator and validation data type. This version of the overload allows you to specify whether values are compared using a culture-neutral format.

  true if the parameter relates to the parameter in the manner specified by the parameter; otherwise, false.

  true to convert the left side value to a culture-neutral format; otherwise, false. true to convert the right side value to a culture-neutral format; otherwise, false. One of the values. One of the values.
- Method
  System.Boolean `` `` `` a a To be added. To be added a To be added 1.0.5000.0 2.0.0.0
- Method
  2.0.0.0
  System.Boolean `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added.
- Property
  2.0.0.0
  System.Web.UI.Themeable(false)
  System.ComponentModel.DefaultValue(false)
  System.Boolean To be added.

  When the property is set to true, properties of the control that are not strongly typed are converted to a culture-neutral format before being compared. When this property is set to false, values are converted to the format of the current culture. The property does not affect values that are entered by users of the control on a Web page.

  This property cannot be set by themes or by style sheet themes. For more information, see and ASP.NET Themes Overview.

  Gets or sets a value indicating whether values are converted to a culture-neutral format before being compared.

- Property
  System.Int32 To be added: an object of type 'int'

  Use the property to determine the maximum year that can be represented by a two-digit year in a 100-year range. For example, if this property contains the value 2029, you can represent the years 1930 to 2029 using a two-digit year. The two-digit year 30 is interpreted as 1930, while 29 is interpreted as 2029. You cannot change the value of this property directly; however, you can change the maximum year that can be represented by a two-digit year by setting the property.

  Gets the maximum year that can be represented by a two-digit year.

  1.0.5000.0
  2.0.0.0
- Method
  System.Boolean

  The method is a helper function used primarily by the property to determine whether the client's browser supports "uplevel" rendering (rendering on a newer browser). The class overrides this method to return false if the current culture uses a non-Gregorian calendar.

  This method is used primarily by control developers.

  Determines whether the validation control can be rendered for a newer ("uplevel") browser.

  true if the validation control can be rendered for an "uplevel" browser; otherwise, false.

  1.0.5000.0
  2.0.0.0
- Method
  System.String

  The month, day, and year of a date value can appear in different orders depending on the current culture settings. The method is used to determine the order in which these values appear. The following table shows the different values returned by this method.

  Date element order

  Return value

  Day, Month, Year

  "dmy"

  Month, Day, Year

  "mdy"

  Year, Month, Day

  "ymd"

  Determines the order in which the month, day, and year appear in a date value for the current culture.

  A string that represents the order in which the month, day, and year appear in a date value for the current culture.

  1.0.5000.0
  2.0.0.0
- Method
  System.Int32 `` To be added: an object of type 'int'

  Use the method to generate the four-digit year representation of the specified two-digit year. The four-digit year representation depends on the value of the property, which contains the maximum year that can be represented by a two-digit year in a 100-year range. For example, if the property contains the value 2029, the method returns a year between 1930 and 2029. The two-digit year 30 is interpreted as 1930, while 29 is interpreted as 2029. You can change the maximum year that can be represented by a two-digit year by setting the property.

  Because this method is static, you can use it without creating an instance of the class by qualifying the method name along with the class name--for example, BaseCompareValidator.GetFullYear.

  Generates the four-digit year representation of the specified two-digit year.

  The four-digit year representation of the specified two-digit year.

  1.0.5000.0
  2.0.0.0
- Property
  System.Web.UI.WebControls.ValidationDataType To be added: an object of type 'ValidationDataType'

  Use the property to specify the data type used for comparison. The property is used differently by the various comparison validation controls.

  When the property is set to and the current calendar type is non-Gregorian, the validator performs server-side validation only. The validator client script supports only Gregorian calendars.

  For example, in the control, all values being compared (the upper bound, lower bound, and value of the input control) are converted to the specified data type before any comparison is performed. However, if you use a control and set its property to ValidationCompareOperator.DataTypeCheck, only the value of the input control is converted to the specified data type.

  If the value of the input control associated with the validation control cannot be converted to the specified data type, validation fails. The property of the validation control is set to false.

  The following table lists the values that you can use for the property.

  Data type

  Description

  String

  Specifies a string data type.

  Integer

  Specifies a 32-bit signed integer data type.

  Double

  Specifies a double-precision floating-point number data type.

  Date

  Specifies a date data type.

  Currency

  Specifies a monetary data type.

  This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.

  Gets or sets the data type that the values being compared are converted to before the comparison is made.

  1.0.5000.0
  2.0.0.0
  System.Web.UI.Themeable(false)
  System.ComponentModel.DefaultValue(System.Web.UI.WebControls.ValidationDataType.String)