How to add Kendo UI HTML helpers to my ASP.net MVC 4 project?

前端 未结 1 1576
北海茫月
北海茫月 2021-01-14 06:26

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 refere

相关标签:
1条回答
  • 2021-01-14 06:56

    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>
    

    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>
    

    Use any Kendo UI HtmlHelper extension

    @(Html.Kendo().DatePicker().Name("Birthday"))
    

    more details at http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/introduction

    0 讨论(0)
提交回复
热议问题