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

[ControlName] does not exist in the current context

10 Answers 1792 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
G S S
Top achievements
Rank 1
G S S asked on 15 Jan 2010, 09:39 PM
Hi,

I have RAD Ajax Controls 2009 Q3 installed, no problem.

I am not sure why, but when I build my site, I get errors like this:

Error    4    The name 'RadMenu1' does not exist in the current context    C:\inetpub\wwwroot\The Playgrounds\The Playgrounds\RSSReader.aspx.cs    150    21    The Playground

I do indeed have a RADMenu with that name in the page, but the codebehind cannot see it.

I have references added to Telerik.Web.UI and my ASPX does too:

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>


What am I doing wrong?







10 Answers, 1 is accepted

Sort by
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 15 Jan 2010, 11:13 PM
This just started happening after the upgrade?

Can you post the code?
0
G S S
Top achievements
Rank 1
answered on 16 Jan 2010, 07:09 PM
Hi,

Yes it did. However, this can easily be a problem not related to Telerik but instead to ASP.NET.

Sample code on my codebehind.

RadMenu1.DataSource = o; // Where o is object.

And RadMenu1 won't be found.

There are more errors on the pages themselves:

I add a RadScriptManager and the control displays the grey box saying "Unhandled exception occured. Could not load file or assembly [FQAN]. The system could not find the file specified".


Thanks

0
Veselin Vasilev
Telerik team
answered on 20 Jan 2010, 03:25 PM
Hello,

Please make sure that items in your toolbox are from the same assembly version as the project references.

As for the other problem - could it be that the RadMenu1 is placed inside a templated control? This way its ID cannot be used directly, but first need to be found with FindControl.

Are you using a web site or a web application? If the latter - make sure that the .designer file contains the proper definition of the menu.

Sincerely yours,
Veskoni
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
G S S
Top achievements
Rank 1
answered on 30 Jan 2010, 12:46 AM
Hi,

The site is a web application.

Your designer tip is good. I just checked my aspx pages and some don't have designers.

For one page which does not have a designer, I added a RadSlidingPanel and I can see the variable from my codebehind. Fine. But I also added a RADGrid and it gives a grey box on the aspx page stating FileNotFound exception could not load or find assembly [name] or one of its dependencies.

The web.config file was also modified when adding these controls.

0
G S S
Top achievements
Rank 1
answered on 03 Feb 2010, 10:46 PM
I made a new project which was a Telerik C# site.

The controls added by default to the default.aspx page (RadscriptManager and 2 others) give a filenotfound exceptio when viewed in design mode. I did not try to use these variables (ie radScriptManager1) in the code behind, but I suspect the variable won't be picked up.

I did uninstall VS2008 Standard and installed VS 2008 Pro. I think this may be part of the problem (installed telerik controls, uninstalled vs 2008 standard, installed VS2008 Professional, and then uninstalled telerik controls and then the latest version (which I think is still at the major release).

Looks like this is not an app problem (with my project), but with the install or VS.

Any more ideas? A link here (http://www.sitefinity.com/support/forums/sitefinity-3-x/deployment/could-not-load-file-or-assembly-telerik-cms-or-one-of-its-dependencies.aspx) although Sitefinity, says I should clear the temp ASP.NET folder (may be worth a try).
0
Veselin Vasilev
Telerik team
answered on 08 Feb 2010, 12:27 PM
Hi

Please install SP1 of Visual Studio 2008. You can find more workarounds here:
design time troubleshooting

Sincerely yours,
Veskoni
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Rynhardt
Top achievements
Rank 1
Iron
answered on 20 May 2016, 08:54 AM

hi,

I have a RadOrgCahrt and RadSearchBox control in my web application (using Visual studio 2015), when I build my project I get the attached errors in the file ,The name 'RadOrgChart1' does not exist in the current context

kindly advise on how I can eliminate or resolve this two errors

 

 

 

0
Konstantin Dikov
Telerik team
answered on 25 May 2016, 06:51 AM
Hi Rynhardt,

The error that you are seeing indicates that you are trying to access control which is not present in the scope. Can you please ensure that the RadOrgChart1 is not placed within a template or is not nested in another control?

If the issue persists, please provide some additional information on the exact scenario.


Regards,
Konstantin Dikov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Teja
Top achievements
Rank 1
Veteran
answered on 11 Jun 2020, 01:12 PM

I got same exception while working with RadOrgChart.I had copy pasted example from Telerik website into Visual Studio 2017 Web application, so designer file for default.aspx page wasn't generated for HTML text i pasted. In my case, designer file was not generated due to missing below content tag.

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">

Now it is working fine but ran into telerik assembly issues.

Could not load file or assembly 'Telerik.Web.UI, Version=2019.2.514.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

0
Doncho
Telerik team
answered on 11 Jun 2020, 03:52 PM

Hi Hariteja,

A possible reason for the experienced issue could be a license file error, which prevents building the solution.

Please try the troubleshooting steps listed in the Visual Studio 2017 Build warnings on Telerik.Web.UI.dll forum post.

I hope that will help!

Kind regards,
Doncho
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
G S S
Top achievements
Rank 1
Answers by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
G S S
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Rynhardt
Top achievements
Rank 1
Iron
Konstantin Dikov
Telerik team
Teja
Top achievements
Rank 1
Veteran
Doncho
Telerik team
Share this question
or