如何将 Kendo UI HTML 助手添加到我的 ASP.net MVC 4 项目? [英] How to add Kendo UI HTML helpers to my ASP.net MVC 4 project?

查看:11
本文介绍了如何将 Kendo UI HTML 助手添加到我的 ASP.net MVC 4 项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题:我已经在我的工作站上安装了 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>

向您的 web.config 添加对 Kendo.Mvc.UI 命名空间的引用.然后 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

这篇关于如何将 Kendo UI HTML 助手添加到我的 ASP.net MVC 4 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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