我正在尝试使用 Telerik RadGrid,但收到以下警告:
"Element 'RadGrid' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing."
以下是我已经检查过的一些内容:
- web.config 文件没有丢失,并且没有任何其他文件 页面上的编译问题。
- Telerik.Web.UI dll 位于 GAC 中,以及该项目的引用 指向该文件。 bin 文件夹中没有 Telerik dll。
- 在程序集中使用此程序集将程序集添加到 web.config 中
部分:
<add assembly="Telerik.Web.UI, Version=2011.1.413.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
- RadGrid 的属性有效,因此 Visual Studio 能够 找出物体是什么
- 页面运行正常,我只是有这组烦人的 警告。
- 我尝试在页面上为 Telerik 程序集添加 @Register 语句,但没有任何变化
- 我尝试清理/重建,但没有改变
- 我尝试重新启动 Visual Studio,没有任何变化
- 我尝试重新启动机器,没有任何变化
编辑: 这是我正在使用的标记。
<%@ Page Title="" Language="C#" MasterPageFile="~/masterPages/ActionAreaSinglePanelMaster.Master" AutoEventWireup="true" CodeBehind="overview.aspx.cs" Inherits="Compass.overview" %>
<asp:Content ID="PanelHeaderContent" ContentPlaceHolderID="PanelHeaderPlaceholder" runat="server">
<p>Panel header</p>
</asp:Content>
<asp:Content ID="PanelContent" ContentPlaceHolderID="PanelDataPlaceholder" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../Scripts/radGridLayout.js" type="text/javascript"></script>
<script type="text/javascript">
panelGridID = "<%=panelGrid.ClientID %>";
</script>
<asp:ObjectDataSource ID="BundleItemsSource" runat="server" TypeName="Compass.Data.CompassUI" SelectMethod="BundleDataSet">
<SelectParameters>
<asp:QueryStringParameter Name="bundleID" QueryStringField="bundle" />
</SelectParameters>
</asp:ObjectDataSource>
<telerik:RadGrid id="panelGrid" runat="server" DataSourceID="BundleItemsSource" Height="100%" Width="100%">
<ClientSettings>
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<ClientEvents OnGridCreated="gridCreated" />
</ClientSettings>
</telerik:RadGrid>
</asp:Content>
最佳答案
关闭 Visual Studio,删除架构缓存,然后重新打开 Visual Studio。您可以在以下内容中找到架构:
C:\Users\karthik\AppData\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas
删除此文件夹中的所有文件是安全的。
关于asp.net - 元素 'RadGrid' 不是已知元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7727663/