This is a migrated thread and some comments may be shown as answers.

RadGrid insine UserControl makes the UserControl "not a known element"

3 Answers 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Heikki Heikkinen
Top achievements
Rank 1
Heikki Heikkinen asked on 13 Jul 2010, 11:20 AM
I ran into an interesting issue with the RadGrid.
I wanted to add a RadGrid into a UserControl and then add this UserControl to an aspx page. As soon as I add a RadGrid into the UserControl VisualStudio 2010 underlines the user control declaration on the page and when you hover on it to see what the problem is there is an error message: "Element 'TheUserControl' is not a known element. This can occuur when there is a compilation error in the Web site, or the web.config file is missing."

The page compiles and runs fine and the web.config file is not missing. Do you know what could be causing this?

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 15 Jul 2010, 12:54 PM
Hi Heikki,

You can try registering the UserControl in the controls section of your web.config file:

<?xml version="1.0"?>
<configuration>
  <system.web>   
    <pages>
      <controls>
        <add tagPrefix="UserControlTagPrefix" src="~/Controls/UserControl.ascx" tagName="UserControl"/>
      </controls>
    </pages>
  </system.web>
</configuration>

Please, let us know if the issue persists after doing so.

Kind regards,
Tsvetina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Heikki Heikkinen
Top achievements
Rank 1
answered on 15 Jul 2010, 01:16 PM
This did not help. This is not a critical problem since everything compiles and runs just fine.

PS. I added a RadCodeBlock to my other UserControl that didn't have this problem. After adding the RadCodeBlock this same issue appeared with that UserControl.
0
Tsvetina
Telerik team
answered on 19 Jul 2010, 08:48 AM
Hi Heikki,

This is usually caused by some inconsistency in assembly refrences. Check if there are references to any older versions.

Also, does the warning occur after performing a drag-and-drop of a control from the Visual Studio Toolbox? It could be that the ToolBox is populated with controls from a Telerik.Web.UI assembly, having a different version than the one in the project's BIN folder.

Additionally, there are a few other forum threads discussing the same issue with different reasons for the warnings. Here are links to two of them with the most possible solutions mentioned (if you search in the forum, more will show up):
Element '[xxx]' is not a known element
RadGrid is Not a Known Element Error


Best wishes,
Tsvetina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Heikki Heikkinen
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Heikki Heikkinen
Top achievements
Rank 1
Share this question
or