Client side validation script dissapears with $.ajax()
- by boris callens
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?