Kendo UI reference not working in Razor view

后端 未结 10 2342
感情败类
感情败类 2021-02-19 09:10

I am trying to create a Telerik Grid view but when I go to reference kendo it does not recognize it. Visual Studio is giving me an error when I try to reference kendo. This is t

相关标签:
10条回答
  • 2021-02-19 09:28

    For me, it was _ViewImports.cshtml that I needed to edit

    @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
    @addTagHelper *, Kendo.Mvc
    @using Kendo.Mvc.UI
    

    Now with asp.net core 2.2 the razor page is resolving the @(Html.Kendo()...

    0 讨论(0)
  • 2021-02-19 09:29

    I just added the below line in razor page. Its working for me.

    @using Kendo.Mvc.UI;

    0 讨论(0)
  • 2021-02-19 09:39

    The problem is that you have not included a reference to the Kendo.Mvc.dll. There's an explanation on how to do this in the documentation located here

    By default the the root kendo directory is installed at C:\Program Files (x86)\Telerik

    0 讨论(0)
  • 2021-02-19 09:40

    AddKendo.Mvc.dll through NugetPackage and Add Kendo.Mvc

    Add Namespace in webconfig file

    <system.web>
    <pages>
        <namespaces>
            <add namespace="Kendo.Mvc.UI" />
        </namespaces>
    </pages>
    

    0 讨论(0)
  • 2021-02-19 09:42

    Step1: Add Kendo.Mvc.dll to references. You can use the following NuGet gallery command.

    Install-Package Kendo.Mvc -Version {yourversion}
    

    Step2: Add the js and css File of Kendo

    <link href="@Url.Content("~/Content/kendo/2017.3.1018/kendo.common.min.css")" rel="stylesheet" type="text/css" />
    
    <link href="@Url.Content("~/Content/kendo/2017.3.1018/kendo.mobile.all.min.css")" rel="stylesheet" type="text/css" />
    
    <link href="@Url.Content("~/Content/kendo/2017.3.1018/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
    
    <link href="@Url.Content("~/Content/kendo/2017.3.1018/kendo.default.min.css")" rel="stylesheet" type="text/css" />
    
    <link href="@Url.Content("~/Content/kendo/2017.3.1018/kendo.dataviz.default.min.css")" rel="stylesheet" type="text/css" />
    
    <script src="@Url.Content("~/Scripts/kendo/2017.3.1018/jquery.min.js")"></script>
    
    <script src="@Url.Content("~/Scripts/kendo/2017.3.1018/jszip.min.js")"></script>
    
    <script src="@Url.Content("~/Scripts/kendo/2017.3.1018/kendo.all.min.js")"></script>
    
    <script src="@Url.Content("~/Scripts/kendo/2017.3.1018/kendo.aspnetmvc.min.js")"></script>
    
    <script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
    

    Step3: Add the Kendo.Mvc.UI namespace in web.config file.

    note: if use the Area in Project you should add this code to web.config of Area.

    <system.web>
        <pages>
            <namespaces>
                <add namespace="Kendo.Mvc.UI" />
            </namespaces>
        </pages>
    </system.web>
    
    0 讨论(0)
  • 2021-02-19 09:43

    For those who are still facing the same issue, the following link is an updated blog for the latest versions of ASP MVC

    Using Telerik in an Existing ASP MVC Project

    For ASP MVC 4 Click here

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