Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc @(Html.Kendo()未被intellisense识别_Asp.net Mvc_Kendo Grid_Kendo Asp.net Mvc - Fatal编程技术网

Asp.net mvc @(Html.Kendo()未被intellisense识别

Asp.net mvc @(Html.Kendo()未被intellisense识别,asp.net-mvc,kendo-grid,kendo-asp.net-mvc,Asp.net Mvc,Kendo Grid,Kendo Asp.net Mvc,我正在使用Kendo.mvcdll,下面是我的.cshtml @using Kendo.Mvc.UI @model SupplierPortal.RedirectionApp.Models.SiteDetailViewModel @using System.Web.Optimization @{ ViewBag.Title = "Index"; Layout = null; } <script src="http://

我正在使用Kendo.mvcdll,下面是我的
.cshtml

    @using Kendo.Mvc.UI
    @model SupplierPortal.RedirectionApp.Models.SiteDetailViewModel
    @using System.Web.Optimization
    @{
        ViewBag.Title = "Index";
        Layout = null;
    }
<script src="http://code.jquery.com/jquery-1.11.1.js" type="text/javascript"></script>
@*<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.20/jquery-ui.min.js" type="text/javascript"></script>*@
@*<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.714/styles/kendo.common-bootstrap.min.css" />*@
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.common-bootstrap.min.css" />
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.bootstrap.min.css" />
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.default.mobile.min.css" />
<script src="//kendo.cdn.telerik.com/2016.2.714/js/jquery.min.js"></script>
<script src="//kendo.cdn.telerik.com/2016.2.714/js/kendo.all.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2016.2.714/js/kendo.aspnetmvc.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
    <div>
        @(Html.Kendo().Grid<SupplierPortal.RedirectionApp.Models.SiteDetailViewModel>()
                      .Name("Grid")
                      .Columns(columns =>
                      {
                          columns.Bound(p => p.name).Title("Name");
                          columns.Bound(p => p.gender).Title("Gender");
                          columns.Bound(p => p.designation).Title("Designation").Width("300px");
                          columns.Bound(p => p.department).Title("Department").Width("300px");
                      })

                      .Editable(editable => editable.Mode(GridEditMode.InLine))
                      .Navigatable()
                      .Pageable()
                      .Sortable()
                      .Scrollable()
                      .DataSource(dataSource => dataSource // Configure the grid data source
                      .Ajax()
                      .Model(model =>
                      {
                          //model.Id(x => x.id);
                      })
                          .Read(read => read.Action("Employee_Read", "Home")) // Set the action method which will return the data in JSON format
                       )
        )
    </div>
我还在
viewsweb.Config
中添加了
Kendo.MVC
参考,如下所示

<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="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Routing" />
    <add namespace="SupplierPortal.RedirectionApp" />
    <add namespace="Kendo.Mvc" />

</namespaces>

在主web.config文件中

  <system.web>   
<compilation debug="true" targetFramework="4.5.2" >
<assemblies>       
    <add assembly="Kendo.Mvc" />
  </assemblies>
</compilation>
<httpRuntime targetFramework="4.5.2" />
<httpModules>
  <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
</httpModules>


有人能告诉我哪里做错了,为什么razor不能识别
@Html.Kendogrid()
我也在参考中包含了dll。

你必须使用Telerik团队提供的
Kendo.mvc.dll
。我在nuget安装Kendo.mvc时遇到了同样的问题,但它没有被识别,然后我添加了Telerik团队提供的
.dll
。现在它正在工作。下载试用版,你会发现e> C:\Program Files(x86)中的Kendo.Mvc.dll\Telerik\UI for ASP.NET MVC 2016年第二季度\wrappers\aspnetmvc\Binaries安装后的位置。

您必须使用Telerik团队提供的
Kendo.MVC.dll
。我在nuget安装Kendo.MVC时遇到了同样的问题,但它没有识别出来,然后我添加了Telerik团队提供的
.dll
。现在它正在工作。要关机了加载试用版,您将在安装后的C:\ProgramFiles(x86)\Telerik\UI for ASP.NET Mvc 2016第二季度\wrappers\aspnetmvc\Binaries位置找到
Kendo.Mvc.dll

  <system.web>   
<compilation debug="true" targetFramework="4.5.2" >
<assemblies>       
    <add assembly="Kendo.Mvc" />
  </assemblies>
</compilation>
<httpRuntime targetFramework="4.5.2" />
<httpModules>
  <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
</httpModules>