View Single Post
Old 08-12-2004, 12:19 AM   #10
ashish
TopHosts Senior Member
 
Join Date: Jul 2004
Posts: 108
ashish will become famous soon enough
Default Re: Basic Information about ASP.NET

Hiya,

Thought I should mention the validation server controls in ASP.NET coz they are pretty important.

ASP.NET has got some 6 validation controls


CompareValidator - Is used to compare two different values, returns a Boolean expression.

RequiredFieldValidator - Is used to make sure that there is a value entered in a particular input control i.e. there has been a change of value in the input field, by default the value of such a field is set to "" and if there is no change in this value, it returns a error.

RegularExpressionValidator - You can use this to make sure that the data entered in a particular field is in a pattern defined by you, for example, there might be a field where you want the user to enter the phone number along with country and area code, you can check that the user enters the data in that pattern other wise show an error to the user.

ValidationSummary - This control returns a list of error messages generated by the various validation controls used on a web page.


RangeValidator - Used to check that the data entered by the user is in between a certain range, i.e. the data entered by the user must be between a certain upper & lower limit. You can use it for numbers, character & dates.
For ex: You might want the user to enter a month and so that implies that it should be between 1-12, anything else should normally generate an error. You specify the ranges by using the 'MaximumValue' & 'MinimumValue' property.

CustomValidator - Sometimes you want to perform a validation that is not provided in ASP.NET validation controls, so ASP.NET allows you to code a user defined validation and call it in the CustomValidator. Take the case of a registration form where you want the user to have at least 8 characters, so you write the code to check that and then use it through CustomValidator.

some information from www.w3schools.com & www.411asp.net
__________________
Cheers,
Ashish
M6.Net - ASP Hosting, ASP.Net Hosting
ashish is offline   Reply With Quote