If we already have client side validations why we should use server side validations in mvc [Resolved]

Posted by Kasani007 under ASP.NET MVC on 7/17/2014 | Points: 10 | Views : 775 | Status : [Member] | Replies : 2
if we already have client side validations why we should use server side validations in mvc ?
Shall we can use only Client Side validations ? what are the advantages and disadvantages ?




Responses

Posted by: Goud.Kv on: 7/18/2014 [Member] [MVP] Gold | Points: 50

Up
0
Down

Resolved
Hi,
You can use Client Side validation but,

If you want your site to get hacked, depend on client-side validation. Because,

Client-side validation should be used to minimize the amount of errors that server-side validation will detect. It cannot be used instead of server-side validation.
And, if you depend on Server-side validation, you can end up with a real mess, if the form is remotely complicated.

So use both of them if you want the best result, or use server side only if you want ease of programming.
But never use client side only. Ever too.



Thanks & Regards,
Krishna

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: kgovindarao523-21772 on: 7/18/2014 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,

Simply saying if we already have client side validations, Server side validations are application safety purpose.

Yes, We can use only Client Side validations , what if java-script is disabled in the browser? Application leads to an exception state.

If we write both client and server side validations, it may leads negligible performance degrade.


Thank you,
Govind

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response