[ControlName] does not exist in the current context

9 posts, 0 answers
  1. G S S
    G S S avatar
    85 posts
    Member since:
    Mar 2008

    Posted 15 Jan 2010 Link to this post

    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?







  2. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 15 Jan 2010 Link to this post

    This just started happening after the upgrade?

    Can you post the code?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. G S S
    G S S avatar
    85 posts
    Member since:
    Mar 2008

    Posted 16 Jan 2010 Link to this post

    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

  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 20 Jan 2010 Link to this post

    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.
  6. G S S
    G S S avatar
    85 posts
    Member since:
    Mar 2008

    Posted 29 Jan 2010 Link to this post

    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.

  7. G S S
    G S S avatar
    85 posts
    Member since:
    Mar 2008

    Posted 03 Feb 2010 Link to this post

    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).
  8. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 08 Feb 2010 Link to this post

    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.
  9. Rynhardt
    Rynhardt avatar
    1 posts
    Member since:
    Nov 2015

    Posted 20 May Link to this post

    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

     

     

     

  10. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1798 posts

    Posted 25 May Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017