开发者

ASP.NET MVC, Loading forms via PartialViews

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 do开发者_如何转开发es 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜