开发者

How can I validate partial view that is returned from controller

I have a view page with ajax.action link which returns a partial view fr开发者_如何学编程om controller and render it to divid as updated target id. But I could not perform client side validation on that partial view.

Can I have solution for it?


When you load a partial view's html with ajax it is normal for the JavaScript code not to be executed. Especially if you have calls to functions attached to onload event since this event is fired long before the ajax call is executed. Check out this article http://adammcraventech.wordpress.com/2010/06/11/asp-net-mvc2-ajax-executing-dynamically-loaded-javascript/ it describes all sorts of problems that you can have with this approach. If you want a more specific answer it will be good to proivide more info on your setup like - what version of .net/asp.net mvc you are using and what validation framework are you trying to use.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜