我想在我的Sitefinity视图中使用MVC的控件,如@Html.Kendo().TextBox()和@(Html.Kendo().Grid。在视图中,我添加了ScriptRef.JQuery和ScriptRef.KendoWeb以及样式表,在ASP.NET MVC R3 2020示例项目中,我在Sitefinity中使用了DLL文件Kendo.Mvc.dll包装器作为参考。但是,当我运行应用程序时,我得到的是错误Uncaught TypeError: kendo.syncReady is not a function at Preview:1160。任何对代码定义的步骤的帮助都将非常感谢。
Sitefinity中的包装路径引用
C:\Program Files (x86)\Progress\Telerik UI for ASP.NET MVC R3 2020\wrappers\aspnetmvc\Examples\MVC5\Kendo.Mvc.Examples\bin视图
@using Kendo.Mvc.UI
@Html.Script(ScriptRef.JQuery, "head", true)
@Html.Script(ScriptRef.KendoWeb, "head", true)
@Html.Section("jquery")
@Html.Section("kendo")
@Html.StyleSheet(Url.EmbeddedResource("Telerik.Sitefinity.Resources.Reference", "Telerik.Sitefinity.Resources.Scripts.Kendo.styles.kendo_common_min.css"), sectionName: "head", throwException: false)
@Html.StyleSheet(Url.EmbeddedResource("Telerik.Sitefinity.Resources.Reference", "Telerik.Sitefinity.Resources.Scripts.Kendo.styles.kendo_bootstrap_min.css"), sectionName: "bottom", throwException: false)
@Html.Kendo().TextBox().Name("customSearch")发布于 2020-12-08 05:15:34
这是小部件视图还是页面模板视图?
如果是小部件视图,最好删除以下2节:
@Html.Section("jquery")
@Html.Section("kendo")另外,确保页面视图中有一个名为"head“的部分。
要防止此错误,需要确保您的kendo init代码:
@Html.Kendo().TextBox().Name("customSearch")放在的kendo/jquery脚本之后。
只需检查您的页面源,并确保上述内容是正确的。
https://stackoverflow.com/questions/65159611
复制相似问题