The client-side-validation does not work for forms, included in a response of an _Ajax.ActionLink_ or _Ajax.BeginForm_, because the jQuery Validation does not parse the response HTML, which is appended to the body (_asyncOnSuccess()_ in _jquery.unobtrusive-ajax.js_).
A workaround is to reparse the whole document on every Ajax response:
```
$(document).ajaxSuccess(function() {
$.validator.unobtrusive.parse(document);
});
```
The attached MVC project reproduces this issue on the "Index"-page, and also includes the "SmallFormWithValidation" partial view directly (no ajax call) on the "About"-page to demonstrate the desired behavior of the client-side-validation.
Comments: Hi ulrichb, This combination of functionality is unfortunately not well supported in MVC. Mixing unobtrusive AJAX and validation has a number of issues, including the issue you're seeing. The fundamental problem is that MVC's unobtrusive AJAX support doesn't "know" what kind of state needs to be updated in the browser after the server returns the partial response. We recommend finding workarounds such as manually re-parsing the unobtrusive validation data as you've shown. Thanks, Eilon
A workaround is to reparse the whole document on every Ajax response:
```
$(document).ajaxSuccess(function() {
$.validator.unobtrusive.parse(document);
});
```
The attached MVC project reproduces this issue on the "Index"-page, and also includes the "SmallFormWithValidation" partial view directly (no ajax call) on the "About"-page to demonstrate the desired behavior of the client-side-validation.
Comments: Hi ulrichb, This combination of functionality is unfortunately not well supported in MVC. Mixing unobtrusive AJAX and validation has a number of issues, including the issue you're seeing. The fundamental problem is that MVC's unobtrusive AJAX support doesn't "know" what kind of state needs to be updated in the browser after the server returns the partial response. We recommend finding workarounds such as manually re-parsing the unobtrusive validation data as you've shown. Thanks, Eilon