1

I am a beginner in ASP.Net. We have Validation Controls in ASP.Net. But I want to know, In which scenarios we need to use JavaScript?

3 Answers 3

2

JavaScript will provide you with the ability to do client side validation which will allow you to save server roundtrip and makes your application less chatty, which is generally a good thing. I believe the validation controls in ASP.NET do have the ability to do client side validation as well (it will generate the necessary JavaScript and save you the work).

Sign up to request clarification or add additional context in comments.

1 Comment

There are a lot of sites that do this. Just plug in learn javascript in a search engine and you should find them.
1

Specially in Validation approaches if you need to validate a email address in ASP.NET you need to send a server request and get the resonance

in JS you can validate in client side with out sending a server request

Comments

1

When you want validation to happen on the client side. That is, validate before anything is sent to the server (ie - form submission) so its more responsive and doesn't waste server resource unnecessariy.

This can be done when a submit button is clicked but before the actual request is sent, when a certain input box loses focus, keypresses on a textbox to keep letters out of a numeric input, or pretty much on any event.

3 Comments

So JavaScript is mainly used to done the validation in Client Side. So We can use JavaScript in all the Scenarios.
im not sure what you're getting at. i dont recommend considering this a substitution for server side validation
Ok jon. thank u so much for your contribution. It will be helpful for my career.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.