MVC2 Client-Side Validation for injected Ajax response
- by radu-negrila
Hi,
I have the following scenario for an MVC 2 website.
The user checks a radio.
I make a jQuery GET to retrieve some html (partial view + view model). The view-model is annotated with validation attributes.
I need client-side validation for the new html's inputs.
I tried placing the following line in the partial view:
<% Html.EnableClientValidation(); %
I was naive.
Also for the obtained html I use jQuery's .html to populate my placeholder, which also would execute the javascript. Not that there is any.
Is is possible to update the page's validation logic and metadata after the ajax call ?
Any ideas (beside remote client side validation) ?
Thanks in advance.