MVC2 Client-Side Validation for injected Ajax response

Posted by radu-negrila on Stack Overflow See other posts from Stack Overflow or by radu-negrila
Published on 2010-05-18T13:17:21Z Indexed on 2010/05/18 13:20 UTC
Read the original article Hit count: 328

Filed under:
|
|
|

Hi,

I have the following scenario for an MVC 2 website.

  1. The user checks a radio.
  2. I make a jQuery GET to retrieve some html (partial view + view model). The view-model is annotated with validation attributes.
  3. 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.

© Stack Overflow or respective owner

Related posts about mvc

Related posts about client-side