【问题标题】:How do I get a Kendo DatePicker to work inside an MVC Partial?如何让 Kendo DatePicker 在 MVC Partial 中工作?
【发布时间】:2018-03-09 20:45:33
【问题描述】:

索引.cshtml

@Html.Partial("_DateFieldPartial", field);

_DateFieldPartial.cshtml

@model Simplifyed.Enrollment.Web.Contracts.GenericFormField
@using Kendo.Mvc.UI;
@{
ViewBag.Title = "_DateFieldPartial";
}

<div>
@(Model.FieldLabel):@(Html.Kendo().DatePicker()
    .Name("datepicker")
    .Value("10/10/2011")
    .HtmlAttributes(new { style = "width: 100%", title = "datepicker", id = "123" })
    .Deferred()
    )
</div>

我得到的只是一个文本框,没有什么可点击的。当我单击文本框时,没有任何反应。

我没有使用 NuGet 包,我只引用了 Kendo.MVC.dll

【问题讨论】:

    标签: asp.net-mvc-5 kendo-asp.net-mvc


    【解决方案1】:

    在你的布局中你添加了

    @Html.Kendo().DeferredScripts()

    如上指定

    https://docs.telerik.com/aspnet-mvc/getting-started/fundamentals#configuration-Deferring

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-14
      • 2020-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多