Reputation: 8071
I've set jquery.unobtrusive-ajax.js and jquery.js file and in web.config I've set
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
But it still refreshes the page instead of doing javascript validation.
Also my model has:
[Required(ErrorMessage = "Reguired")]
public string UserName { get; set; }
[Required(ErrorMessage = "Reguired")]
public string Password { get; set; }
Please help
Upvotes: 1
Views: 887
Reputation: 1038770
You need to add jquery.validate.js
and jquery.validate.unobtrusive.js
in that order. jquery.unobtrusive-ajax.js
is to make Ajax.* helpers work, it has nothing to do with validation.
Upvotes: 4