Can anyone tell me why client side validation is not working in my MVC 4 application.
@Scripts.Render("~/bundles/jquery")
@R
If you use jquery.validate.js and jquery.validate.unobtrusive.js for validating on client side, you should remember that you have to register any validation attribute of any DOM element on your request. Therefor you can use this code:
$.validator.unobtrusive.parse('your main element on layout');
to register all validation attributes. You can call this method on (for example) :
$(document).ajaxSuccess() or $(document).ready() to register all of them and your validation can be occurred successfully instead of registering all js files on cshtml files.