What is the difference between server-side and client-side validations?


After the user enters data into a web form and clicks on the Submit button the form data is sent to the server as a request, you can perform server-side validation on the data. If the data is incorrect or not valid, you can send back a response stating the same. This is known as server-side validation.



If, however, when the user clicks the Submit button, a scripting language that is part of the overall HTML page is initiated to check the validity of the data before it is sent to the server, this is known as client-side validation.


In server-side validation a round trip to the server is needed which makes the processing of the page a lot slower than client-side validations where the round trip to the server is omitted and the data is validated on the client side only.

It is always recommended to use a client side validation rather than a server side validation.

Comments

Popular posts from this blog

jQuery Basics

What is the difference between a Page Layout and Master Page in SharePoint?

Accessing data from SharePoint 2010 to an ASP.NET application