0

I am developing an application using ASP.Net MVC and jQuery. Depending on users action, I load partial views into the page using jQuery's $.ajax method.

The problem, I am experiencing, is related to a particular partial view that contains a form, in which the client side validation is enabled. It does seem like the JavaScript code generated in this partial view is not being executed, hence the client validation is not working.

Does anybody have a solution for this issue?

Thanks!

Zen

UncleZen
  • 289
  • 1
  • 4
  • 22

1 Answers1

0

You might need to put all scripts contained in this partial into a separate function. Then in the success callback of you AJAX request simply call this function: it should attach validation to the newly modified DOM.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • Hey Darin, JS validation code is generated on runtime. Therefore, I can not put it in a separate function. – UncleZen Nov 23 '10 at 19:01