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.BaseCompareValidator System.Web.UI.ToolboxData("<{0}:RangeValidator runat="server" ErrorMessage="RangeValidator"></{0}:RangeValidator>")

The control tests whether the value of an input control is within a specified range.

The control uses four key properties to perform its validation. The property contains the input control to validate. The and properties specify the minimum and maximum values of the valid range.

The property is used to specify the data type of the values to compare. The values to compare are converted to this data type before the validation operation is performed.

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.

The following table lists the different data types that can be compared.

Data Type

Description

String

A string data type.

Integer

A 32-bit signed integer data type.

Double

A double-precision floating point number data type.

Date

A date data type.

Currency

A decimal data type that can contain currency symbols.

Validation succeeds if the input control is empty. Use a control to make the input control a mandatory field.

The control throws an exception if the value specified by the or property cannot be converted to the specified .

When you use 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 additional information on validation controls, see .

## Accessibility

For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio 2010 and ASP.NET 4 and ASP.NET Controls and Accessibility.

Checks whether the value of an input control is within a specified range of values.

- Constructor
  To be added

  Initializes a new instance of the class.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void `` To be added

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

  An that represents the output stream to render HTML content on the client. 1.0.5000.0 2.0.0.0
- Method
  System.Boolean To be added

  This is a check of properties to determine any errors made by the developer.

  true if the control properties are valid; otherwise, false.

  1.0.5000.0
  2.0.0.0
- Method
  System.Boolean To be added

  Determines whether the content in the input control is valid.

  true if the control is valid; otherwise, false.

  1.0.5000.0
  2.0.0.0
- Property
  System.String To be added: an object of type 'string'

  Use the 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 property, an exception is thrown.

  If you specify ValidationDataType.Date for the property without programmatically setting the culture for the application, you should use a culture-neutral format, such as YYYY/MM/DD, for the and properties. Otherwise, the date may not be interpreted correctly.

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

  Gets or sets the maximum value of the validation range.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.DefaultValue("")
  System.Web.UI.Themeable(false)
- Property
  System.String To be added: an object of type 'string'

  Use the property to specify the minimum value of the validation range. If the value specified by this property fails to convert to the data type specified by the property, an exception is thrown.

  If you specify ValidationDataType.Date for the property without programmatically setting the culture for the application, you should use a culture-neutral format, such as YYYY/MM/DD, for the and properties. Otherwise, the date may not be interpreted correctly.

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

  Gets or sets the minimum value of the validation range.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.DefaultValue("")
  System.Web.UI.Themeable(false)