nav100
nav100

Reputation: 63

What is the difference of using asp.net validator controls vs JQuery for front end validation

Could you please tell me the difference between using asp.net validator controls vs JQuery for front end validation? What happens if the user turns off javascript on their browser?

Thank you..

Upvotes: 4

Views: 1768

Answers (3)

Joel Coehoorn
Joel Coehoorn

Reputation: 415765

The difference is that "front end" validation by itself has nothing to do with security or real validation. It's entirely a performance optimization — a client validation failure saves a round trip to your server, helping you scale and allowing you to reduce the response time for your users. But the real validation work must take place server-side.

ASP.Net validation controls help you automate the server-side validation and keep it in sync with the client, while jQuery still requires you to write the server-side logic separately.

Upvotes: 5

CodingGorilla
CodingGorilla

Reputation: 19842

The ASP.NET validator controls are a lot easier for the average asp.net developer to use. I think using jquery is probably a lot "cleaner" and more flexible.

Upvotes: 1

Brendan Enrick
Brendan Enrick

Reputation: 4297

The ASP.NET validators will also check server side. You can check a boolean value to see if any have been violated. If JavaScript is disabled the jQuery will do nothing, but the ASP.NET will still be able to check.

You can of course combine the jQUery with your own server-side validation, but it isn't built-in.

Upvotes: 4

Related Questions