Banner Ad

Wednesday, January 30, 2013

A Word about Client Side and Server Side Validation

By Francis   Posted at   11:42 AM   Validators No comments

Most of the programmers are aware about the 2 types of validation. One is Server side validation and another one is Client side validation. Each of them had advantages and disadvantages also. For novice programmers, I just want to give brief intro about these.  

 Client Side Validation:

Basically this validation done in Client side. Since we are in web application development in this blog, the client meant here is the Web browser.  The client side validation functionalities have been implemented by the script languages like javascript, VBScript or any other scripting languages. Typically this client script’s execution engine/interpreter is installed with the browsers. So when a client script related constructs appeared in the HTML file it has been executed by these engines.
        Since these script execution engines are installed with browsers, the user can enable it or disable it for their convenience. I hope you got the first drawback of the client side validation. Yes you are right!. If the user disables the script then user will bypass the client validation. That means in browser it will not fire the event or not working fully. 

 Server Side Validation:

At this point to overcome this drawback, Server validation comes into picture. As its name implies, Server side validation happen in Server.  Here the server denotes the web server in which the web application has been deployed. Server side validation written in Server side languages like VB.Net, C#.Net etc. 
One of the benefits of the Server side validation is it will executed in Server and it will must happen. User doesn’t have choice to stop it. One of the main drawback is, Validation function or routine available in server so to do validation a roundtrip is required. This round-drip time made the Server Validation slower.
            Since the Client side validation is executed in Client, it is very past and responsive. The server side validation on the other hand, guaranteed execution. At any case don’t rely on the client validation. Most of the browsers now support client side scripts. So you are free to allow do implement Client Side validation. It’s a good idea to implement both in a web application.

In a snapshot:
Server Side Validation has:
1.       Guaranteed Execution.
2.       Slower responsive due to roundtrip time.

Client Side Validation has:
1.       User can easily bypass it.
2.       Faster responsive since its execution happen within the client.
I       
         In this i just explained the overview about the client and server side validation. I hope it helps you a bit to understand the both validations. 

Happy Programming!!!!

About Francis

Francis, an Associate at Cognizant. Having 7+ Years of experience in Microsoft web technologies.

0 comments :

Please give your valuable comments to improve the contents

Connect with Us