问题描述
一个简单的问题:我已经在工作站上安装了Telerik DevCraft Ultimate.我看了一些示例,这些示例显示了Kendo UI HTML帮助器的使用.
Simple question: I've installed Telerik DevCraft Ultimate on my workstation. I've looked at the examples showing the use of the Kendo UI HTML helpers.
我可以在我的项目中添加哪些参考以便能够使用它们?
What reference do I add to my project to be able to use them?
推荐答案
配置ASP.NET MVC布局页面以包括Kendo UI Web JavaScript和CSS文件:
Configure your ASP.NET MVC layout page to include the Kendo UI Web JavaScript and CSS files:
<link rel="stylesheet" href="@Url.Content("~/Content/kendo.common.min.css")">
<link rel="stylesheet" href="@Url.Content("~/Content/kendo.default.min.css")">
<script src="@Url.Content("~/Scripts/jquery.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo.web.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo.aspnetmvc.min.js")"></script>
将对Kendo.Mvc.UI命名空间的引用添加到您的web.config.这样,Kendo HtmlHelper扩展将在您的视图中可用.将名称空间添加到web.config(Visual Studio要求,以显示Kendo.Mvc.UI的智能感知)后,重建项目.
Add a reference to the Kendo.Mvc.UI namespace to your web.config. Then the Kendo HtmlHelper extension would be availble in your views. Rebuild your project after adding the namespace to the web.config (required for Visual Studio to show intellisense for Kendo.Mvc.UI).
<system.web.webPages.razor>
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="Kendo.Mvc.UI" />
</namespaces>
</pages>
</system.web.webPages.razor>
使用任何Kendo UI HtmlHelper扩展
Use any Kendo UI HtmlHelper extension
@(Html.Kendo().DatePicker().Name("Birthday"))
更多详细信息,请参见 http://docs.kendoui .com/getting-started/using-kendo-with/aspnet-mvc/introduction
more details at http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/introduction
这篇关于如何将Kendo UI HTML帮助程序添加到我的ASP.net MVC 4项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!