Asp.net mvc 4 无法将mvc4中的剑道ui与vs 2012集成
我正在使用VS2012,并尝试将剑道UI集成到其中。 我已经安装了nuget“剑道UI”,并在_Layout.cshtml中提供了参考Asp.net mvc 4 无法将mvc4中的剑道ui与vs 2012集成,asp.net-mvc-4,kendo-ui,Asp.net Mvc 4,Kendo Ui,我正在使用VS2012,并尝试将剑道UI集成到其中。 我已经安装了nuget“剑道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.d
<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>
当我试图采取新的观点时,剑道是不受支持的
如果我使用以下代码在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
@(Html.Kendo().Grid())
.名称(“网格”)
.DataSource(DataSource=>DataSource//配置网格数据源
.Ajax()//指定使用Ajax绑定
.Read(Read=>Read.Action(“CustomerDetail”、“Home”)//设置将以JSON格式返回数据的操作方法
)
.列(列=>
{
//创建绑定到ProductID属性的列
columns.Bound(product=>product.ProductID);
//创建绑定到ProductName属性的列
columns.Bound(product=>product.ProductName);
//创建绑定到UnitsInStock属性的列
columns.Bound(product=>product.UnitsInStock);
})
.Pageable()//启用分页
.Sortable()//启用排序
)
错误:-System.Web.Mvc.HtmlHelper'不包含'Kendo'的定义,并且找不到接受'System.Web.Mvc.HtmlHelper'类型的第一个参数的扩展方法'Kendo'(是否缺少using指令或程序集引用?)
有什么想法告诉我在视图的wen.config中也添加引用吗
提前谢谢 您必须下载其安装程序(最新版本:
kendoui.aspnetmvc.2013.2.918.commercial.msi
),然后安装它。它没有完全通过nuget包完成,所以您会得到一个错误。(Bhai tamare kendo nu最新版本nuget package mathi nai安装程序,通过下载karvu padshe。)请参阅初始安装指南文档-。
在Web项目\Views\Web.config文件中,检查Kendo.Mvc和Kendo.Mvc.UI是否添加为名称空间
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
...
<add namespace="Kendo.Mvc"/>
<add namespace="Kendo.Mvc.UI"/>
</namespaces>
</pages>
</system.web.webPages.razor>
您好,david,我刚刚安装了最新版本并构建了它的工作名称空间,但在视图的web配置以及主web.config中找不到这样的名称空间,如果它仍然显示相同的名称空间的话。请重新启动并卸载项目,然后重新加载。
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
....
Kendo.Mvc
System.Web.Helpers