0% found this document useful (0 votes)
75 views4 pages

Regularexpressionvalidator:: Validation Controls

The document discusses different validation controls in ASP.NET that check user input. It describes the RequiredFieldValidator, RegularExpressionValidator, CompareValidator, RangeValidator, CustomValidator, and ValidationSummary controls and provides examples of their important properties and how they are used to validate fields.

Uploaded by

Ramesh Ankathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views4 pages

Regularexpressionvalidator:: Validation Controls

The document discusses different validation controls in ASP.NET that check user input. It describes the RequiredFieldValidator, RegularExpressionValidator, CompareValidator, RangeValidator, CustomValidator, and ValidationSummary controls and provides examples of their important properties and how they are used to validate fields.

Uploaded by

Ramesh Ankathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

ASP.

NET PROVIDES THE FOLLOWING


VALIDATION CONTROLS:
 RequiredFieldValidator.
 RangeValidator.
 CompareValidator.
 RegularExpressionValidator.
 CustomValidator.
 ValidationSummary.

RequiredFieldValidator::
Checks that the validated control contains a value. It
cannot be empty. The most important property in the
RequiredFieldValidator is InitialValue.

Properties
controlToValidate="txtName"
errorMessage="Name must be entered"

RegularExpressionValidator:
Checks the value against a regular expression (pattern).
Checks that the value in the control matches a specified
regular expression. The most important property in the
RegularExpressionValidator is
ValidationExpression.
Properties
controlToValidate="txtH"
errorMessage="Hours must be
1-3 digits only"
validationExpression="\d{1,
3}">
CompareValidator:
Checks if the value is acceptable compared to a given
value or compared to the content of another control. The
most important properties in the CompareValidator are
ValueToCompare, ControlToCompare, Operator, and
type.

Properties
controlToValidate="txtR"
ControlToCompare=”txts”
errorMessage="Rate must be numeric"

RangeValidator:
Checks if the input control’s value is within a specified
range. The most important properties in the
RangeValidator are MaximumValue, MinimumValue, and
type.

Properties
controlToValidate="txtDependents"
MaximumValue=10
MinimumValue=0
errorMessage="Must be from 0 to 10"

CustomValidator:
Performs user-defined validation on an input control
using a specified function (client-side, server-side, or
both). The most important property in the
CustomValidator is ClientValidationFunction.

Properties
controlToValidate="txtDeptNum"
onServerValidate="validateDeptNum"
errorMessage="Must be in multiples of 10"

ValidationSummary:
Displays a summary of all current validation errors. In other
words, reports a summary of all errors. The most important
properties in the ValidationSummary are DisplayMode,
ShowHeaderText, ShowMessageBox, and ShowSummary.

Properties
headerText="Please correct the following
errors"
showSummary= "True"

You might also like