剑道UI MVC 4:表单验证里面窗口不火 [英] Kendo UI MVC 4: Form Validation inside a Window does not fire

查看:208
本文介绍了剑道UI MVC 4:表单验证里面窗口不火的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ASP.NET MVC 4我通过LoadContentFrom()加载的内容内(形式)声明的窗口:

Using ASP.NET MVC 4 I have a window declared with the inner contents (a form) loaded via LoadContentFrom() :

@(Html.Kendo().Window()
      .Name("windowAttachClient")
      .Title("Attach Client")
      .LoadContentFrom("MyAction", "ManageUser", new {a= Model.a})
      )

该窗口将出现罚款和内容构成负荷和作品,但在客户端验证不起作用。在web.config注意我已经验证设置:

The window appears fine and the contents form loads and works, but the client side Validation does not work. Note I have validation set in the Web.Config:

<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />

如果我谨从外部动作和硬code在网页上插入窗口中的内容,然后验证工作。

If I move the contents from the external action and hard code them on the page into the Window, then validation works.

有没有办法有一个窗口,有由LoadContentFrom()加载内容的形式,客户端验证工作的?

Is there a way to have a window , that has a form in the contents loaded by LoadContentFrom(), work with client side validation?

推荐答案

我猜这是因为内容被注入到页面中,你需要处理负载事件,然后告诉验证器解析新形式一旦它被装入的dom。另一种快速的选择是将窗口切换到iframe的模式。

I am guessing this is because the content is being injected into the page, you would need to handle the load event and then tell the validator to parse the new form once it is loaded into the dom. Another quick option would be to switch the window to iframe mode.

    .Iframe(true)

这篇关于剑道UI MVC 4:表单验证里面窗口不火的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆