开发者

ASP.NET MVC: making MicrosoftMvcValidation.js work with dynamically created controls

I'm currently using MicrosoftMvcValidation.js to do client-side validation on a large web application we're developing. It works fine up until the point where we start adding controls after the page loads.

What will I have to do to validate dynamically created controls using Microsoft's solution?

I see that the call to OutputClientValidation() is responsible for writing the json string after the form is rendered. I was wondering if I could somehow use some code in there to add to the script at the bottom 开发者_运维百科whenever I add a new control, but I have no idea where to start...

Note: My dynamic controls are not loaded asynchronously, I'm just writing html using javascript.


your problem is that the page has allready loaded and in which case the page does not have code that validates it...

you might have a look at Dynamic partial view + jquery form hijack + client validation = not working

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜