Freigeben über


Introduction to the RangeValidator Control 

Use the RangeValidator control to validate that user input falls within a specified range. Set the RangeValidator control's ControlToValidate property to the ID of the SelectionList or TextBox to validate.

ASP.NET Range Validator

Specify minimum and maximum range values by using the MinimumValue and MaximumValue properties. If the validation fails, the RangeValidator control displays the text in its ErrorMessage property.

When you add a RangeValidator control to a container control or template, the following settings are made:

  • The ErrorMessage property is set to "RangeValidator".

  • The StyleReference property is set to "error", which is the name of a predefined style in the default StyleSheet.

See Also

Tasks

How to: Add and Configure a RangeValidator Control
How to: Add and Configure a CustomValidator Control
How to: Add and Configure a RangeValidator Control
How to: Add and Configure a RegularExpressionValidator Control
How to: Add and Configure a RequiredFieldValidator Control
How to: Add and Configure a ValidationSummary Control

Reference

RangeValidator

Concepts

Introduction to the Validation Controls