Você está na página 1de 18

Validation Controls

By

SRIRAM. B
Validation Controls

 Required Field Validator


 Compare Validator
 Range Validator
 Regular Expression Validator
 Custom Validator
 Validation Summary
Setting Display Property
 Display property determines how the validation error message is rendered.
This property accepts any of the following possible values:-
 Static
- Screen space is reserved for the error message even if no validation occurs.
 Dynamic

- No initial space is reserved for the error message. If an error occurs, the
succeeding from fields are pushed to make the space for the error messages.
 None
- No error message is displayed.
Page.IsValid
 To determine if all input validation controls on a page are
valid.
if(Page.IsValid)
{
lblMessage.Text=”Page.Is Valid!”;
}
Required Field Validator
 Ensures that the user does not skip from entry field.
Property
ControlToValidate -
Specifies the ID of the control to be validated.

Display -
Sets how the error message contained in the Text Property is displayed.
Possible Values are Static, Dynamic, None
Compare Validator
 Allows for comparisons between the user's input and another
item using a comparison operator(equals, greater than, less
than,and so on)
Range Validator
 Checks the user's input based upon a lower-and-upper level
range of numbers ors characters
Regular Expression Validator

 Checks that the user entry matches a pattern defined by a


regular expression. This is a good control to use to check e-
mail addresses and phone numbers.
Custom Validator

 Checks the user entry using custom coded validation logic.


Validation Summary
 Displays all the error messages from the validators in one
specific spot on the page.
Demo
Session Ends
Exercise
Relax

Você também pode gostar