Client side validation script dissapears with $.ajax()

Posted by boris callens on Stack Overflow See other posts from Stack Overflow or by boris callens
Published on 2010-05-28T10:02:17Z Indexed on 2010/05/28 10:22 UTC
Read the original article Hit count: 158

Filed under:
|
|

In my javascript file I'm getting the content of a partial with the following call:

 $.ajax({
  type: "GET",
  url: value.href.replace(actionType, actionType + 'Partial'),
  dataType: "html",
  success: function(result) {
   $("#DepartmentsAction").html(result);
   alert(result);
  }
 });

Because the partial has the call Html.EnableClientValidation() the resulting html has a static script in it. In the result variable in the ajax call this script is present. In the page where the html gets inserted (#DepartmentsAction) the script has dissapeared.

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX