Smart Server Validiation Controls in Asp.net

Background

In this blog i will explain about the diffrent types of validataion controls which are availble in asp.net framework to validates the form controls before submiting the data on server. this blog i have written specially focusing on freshers to introduce them about basic validation controls in asp.net.Aslo some time this is most commanly asked interview question that what are the Server side valiadatar..? at that time many canidate get confused also experienced candidates.
so above considering the requirement i have written this blog to make basic introduction about these controls.

Introduction

Presently, ASP.NET has six smart validation controls in .NET 3.5 and .NET 4.0 These controls are called smart valdiation controls because they can perform validation both on client side and server side.

The best thing is ASP.NET performs browser detection when generating the ASP.NET page and makes decisions based on the information it has.
This means that if the browser can support the JavaScript then  the validation occurs on the client-side and If the client cannot support the JavaScript means for client-side validation, this JavaScript is omitted and the validation occurs on the server.

Even if client-side validation is initiated on a page, ASP.NET still performs the server-side validation when it receives the submitted page, that  ensuring security won't be compromised.

Their are Six Server Valiadation controls in Asp.net which are as follows..

RequiredFieldValidator control

this control is used to ensure  that the control it has to be used for  validate is not empty when the form is submitted. means suppose their is one Textbox control and you have used RequiredFieldValidator to valiadte that texbox then before submiting the data on server it checks the texbox is not empty.

RangeValidator

Checks that the value of the associated control is within a  specified range. The value and the range can be numerical, a  date or a string. means suppose their is one texbox and you wants to allow only 10 digits or any strings with specified range with help of  RangeValidator  then before submiting the data on server it make sure that value is within a spefied range

 CompareValidator

Checks that the value of the associated control matches a  specified comparison (less than, greater than, and so on)  against another constant value or control. 

RegularExpressionValidator

Checks if the value of the control it has to validate matches the specified regular expression.

CustomValidator

Allows you to specify any client-side JavaScript validation  routine and its server-side counterpart to perform your own  custom validation logic .

ValidationSummary

Shows a summary with the error messages for each failed  validator on the page (or in a pop-up message box).

I hope this small introduction makes all of you useful and after that soon i will write the one article about the importance of asp.net Validatetars behind the JavaScript with example.

If you have any suggestion regarding this blog then please contact me i will improve content of my blog