asp.net.ph

Skip Navigation Links

Types of Validation

ASP.NET Web Forms   Web Forms Server Controls   Web Forms Validation


The following table lists the types of validation controls available and how you can use them.

Type of validation Control to use Description
Required entry RequiredFieldValidator Ensures that the user does not skip an entry.
Comparison to a value, to a data type, or to a database value CompareValidator Compares a user’s entry against a constant value, a value derived from another control, or a database value using a comparison operator ( less than, equal, greater than, and so on ) .
Range checking RangeValidator Checks that a user’s entry is between specified lower and upper boundaries. You can check ranges within pairs of numbers, alphabetic characters, and dates. Boundaries can be expressed as constants or as values derived from another control.
Pattern matching RegularExpressionValidator Checks that the entry matches a pattern defined by a regular expression. This type of validation allows you to check for predictable sequences of characters, such as those in social security numbers, e-mail addresses, telephone numbers, postal codes, and so on.
User-defined CustomValidator Checks the user’s entry using validation logic that you code yourself. This type of validation allows you to check for values derived at run time.

You can attach more than one validation control to an input control. For example, you might specify that a control is both required and that it contain a specific range of values.

See Also

Data Entry Validation ( Client-Side )



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note