Follow in Twitter & Facebook


Like in Facebook

Powered By Blogger Widgets

Free Download

FREE Tools


Monday, March 19, 2012

Validation controls in Asp.net

Validation controls are there in asp.net to validate proper entry of data. Here we will discuss the validation controls available in asp.net and we will see some important properties of each validators. You can also read Web.config and Machine.config asp.net.
There are 6 validation controls in asp.net. These are
(1)-Requiredfield validator
(2)-Range validator
(3)-Compair validator
(4)-RegularExpression validator
(5)-Validation Summary
(6)-Custom validator

(1)-Requiredfield validator:
This validator will not allow textbox blank.
Properties:
Control to validate
Error message

(2)-Range validator:

Validate the textbox within a perticular range of values.
Properties:
Control to validate
Min value
Max value
Error Message

(3)-Compair validator:
Use this control to compair the values with in different textboxes
Properties:
Control to validate
Control to compair
type
Operator
Error Message

(4)-RegularExpression validator:
Validate textbox data based on a perticular pattern or expression then we require regular expression validator.
For ex pattern like
/d{5}-> Number will be 5 digits.
Properties:
Control to validate
validation Expression
Error message

(5)-Validation Summary:
It displays summary of all current validation errors on an asp.net page.
Properties:
Display mode
Show Messagebox
Show Summary

(6)-Custom validator:
It is used to define some user defined validation or some custom validation.




0 on: "Validation controls in Asp.net"