0

I am loading partial views by calling the server preredendering the content on the server and dumping the returned html to the page. This is then displayed in a div on the page. The partial view contains all the functionality for this form including the javascript to make the ajax calls.
I can make everything work in this but the form validation that would come over automaticly if the partial view was written during the initial page load.

I am thinking that something has to get tied together. Perhaps some portion of the validation is only tied in on a full page load and not on the partial render. I just need to figure out the javascript call that needs to happen to have it work correctly.

DanScan
  • 831
  • 2
  • 10
  • 23
  • Possible duplicate of [MVC3 Unobtrusive Validation Not Working after Ajax Call](http://stackoverflow.com/questions/7048726/mvc3-unobtrusive-validation-not-working-after-ajax-call). – Zabavsky Sep 17 '13 at 14:47

1 Answers1

0

did you use following line in your partial view

Html.EnableClientValidation(true);
Html.EnableUnobtrusiveJavaScript(true);

Please add reference of following js:

<script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>

I hope this will help!

SoftSan
  • 2,482
  • 3
  • 23
  • 54