我正在使用VS 2012尝试集成Kendo UI。 我已经安装了nuget“Kendo UI”,并且在_Layout.cshtml中引用了它。
<link rel="stylesheet" href="@Url.Content("~/Content/kendo/2013.2.716/kendo.common.min.css")">
<link rel="stylesheet" href="@Url.Content("~/Content/kendo/2013.2.716/kendo.default.min.css")">
<script src="@Url.Content("~/Scripts/kendo/2013.2.716/jquery.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2013.2.716/jquery.min.js")"></script>
当我尝试创建新视图时,Kendo不支持。
如果我在customerdetail.cshtml中写入以下代码:
@(Html.Kendo().Grid<KendoUIDemo.Models.Customer>()
.Name("grid")
.DataSource(dataSource => dataSource // Configure the grid data source
.Ajax() // Specify that ajax binding is used
.Read(read => read.Action("CustomerDetail", "Home")) // Set the action method which will return the data in JSON format
)
.Columns(columns =>
{
// Create a column bound to the ProductID property
columns.Bound(product => product.ProductID);
// Create a column bound to the ProductName property
columns.Bound(product => product.ProductName);
// Create a column bound to the UnitsInStock property
columns.Bound(product => product.UnitsInStock);
})
.Pageable() // Enable paging
.Sortable() // Enable sorting
错误:-“System.Web.Mvc.HtmlHelper”不包含“Kendo”的定义,也没有找到接受类型为“System.Web.Mvc.HtmlHelper”的第一个参数的扩展方法“Kendo”(是否缺少使用指令或程序集引用?)
请问我已经在视图的web.config中添加了引用,有任何想法吗? 提前感谢!!