元素“RadGrid”不是已知元素
我正在尝试使用 Telerik RadGrid,但收到以下警告:
“元素“RadGrid”不是已知元素。如果存在,则可能会发生这种情况 网站中存在编译错误,或者 web.config 文件存在 失踪了。”
是我已经检查过的一些内容:
- web.config 文件没有丢失,并且没有任何其他文件 页面上的编译问题。
- Telerik.Web.UI dll 位于 GAC 中,项目的参考文献 指向该文件。 bin 文件夹中没有 Telerik dll。
- 在程序集中使用此程序集将程序集添加到 web.config 中 部分:
- 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>
I'm trying to use the Telerik RadGrid, but I'm getting the following warning:
"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."
Here are some things that I've already checked:
- The web.config file isn't missing, and there aren't any other
compilation problems on the page. - The Telerik.Web.UI dll is in the GAC, and the project's references
point to that file. No Telerik dlls in the bin folder. - The assembly is added in the web.config using this in the assemblies
section:<add assembly="Telerik.Web.UI, Version=2011.1.413.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
- The properties of the RadGrid work, so Visual Studio is able to
figure out what the object is - The page runs normally, I just have this annoying set of
warnings. - I tried adding an @Register statement for the Telerik assembly on the page, but got no change
- I tried clean/rebuild, but no change
- I tried restarting Visual Studio, no change
- I tried restarting the machine, no change
EDIT:
Here's the markup I'm using.
<%@ 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
关闭 Visual Studio,删除架构缓存,然后重新打开 Visual Studio。您可以在以下内容中找到架构:
删除此文件夹中的所有文件是安全的。
Close Visual Studio, delete the schema cache, and re-open Visual Studio. You can find the schemas under something like:
It is safe to delete all files in this folder.
更改程序集属性以删除特定版本、公钥等显然解决了问题。
Changing the Assembly attribute to remove the specific version, public key, etc apparently fixed the problems.