Kendo UI 参考在 Razor 视图中不起作用 [英] Kendo UI reference not working in Razor view

查看:23
本文介绍了Kendo UI 参考在 Razor 视图中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建 Telerik Grid 视图,但是当我参考 kendo 时,它无法识别它.当我尝试引用剑道时,Visual Studio 给我一个错误.这是代码 @(Html.Kendo().Grid),下面是错误.

I am trying to create a Telerik Grid view but when I go to reference kendo it does not recognize it. Visual Studio is giving me an error when I try to reference kendo. This is the code @(Html.Kendo().Grid) and below is the error.

'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Kendo' and no extension method 'Kendo' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)

我在 BundleConfig 文件中为脚本和内容添加了一个包.此外,我已将 @Scripts.Render("~/bundles/kendo")@Styles.Render("/Content/kendo") 直接添加到剃刀视图.

I have added a bundle in the BundleConfig file for both Scripts and Content. Also I have added @Scripts.Render("~/bundles/kendo") and @Styles.Render("/Content/kendo") directly to the razor view.

我读过的许多文章都表明将 <add namespace="Kendo.Mvc.UI"/> 添加到 Web.Config 文件会起作用,但它仍然会抛出同样的错误.

Many articles that i've read suggest that adding <add namespace="Kendo.Mvc.UI"/> to the Web.Config file would work but it still is throwing out the same error.

有什么我遗漏的吗?

推荐答案

问题是您没有包含对 Kendo.Mvc.dll 的引用.在位于 这里

The problem is that you have not included a reference to the Kendo.Mvc.dll. There's an explanation on how to do this in the documentation located here

默认情况下,剑道根目录安装在 C:Program Files (x86)Telerik

By default the the root kendo directory is installed at C:Program Files (x86)Telerik

这篇关于Kendo UI 参考在 Razor 视图中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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