We will discuss the validation controls available in asp.net and we will see some important properties of each validators.
Also you can check out:
- Bind dropdownlist using arraylist or hashtable in C#.Net
- File upload and thumbnail creation in Asp.Net
- Retrieve browser details using C#.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)- Compare validator:
Use this control to Compare the values with in different textboxes
Properties:
Control to validate
Control to Compare
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.
Also you can check out:
- Bind dropdownlist using arraylist or hashtable in C#.Net
- File upload and thumbnail creation in Asp.Net
- Retrieve browser details using C#.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)- Compare validator:
Use this control to Compare the values with in different textboxes
Properties:
Control to validate
Control to Compare
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.