none
aspx files can't see code behind files - code behind files can't see aspx.designer.cs files RRS feed

  • Question

  • The aspx file's header:
    <%@ Page Language="C#"  AutoEventWireup="True" Inherits="MyApp.edtPerson" Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" Codebehind="edtPerson.aspx.cs" %>
    The code aspx.cs & aspx.designer.cs are both under the namespace 'MyApp'
    namespace MyApp
    {
              .  .  .
    }
    In the IDE the aspx.cs file is nested under the aspx file, as is the aspx.designer.cs file (right below the aspx.cs file like it should be).
    The server side code <%= sCurrentStyle %> in the aspx file cannnot see any of the code in the aspx.cs file (for example a sCurrentStyle variable)
    The aspx.cs file cannot see any of the code in the aspx.designer.cs, namely the Web Form control names (ie: FirstName).
    When I look at the code in the aspx files any variables instantiated (most as protected) in the codebehind files is red and mouseover reveals an error saying that the reference does not exist.
    When I compile I get over 2200 errors (from multiple pages) because the codebehind files cannot see the controls as laid out in the aspx.designer.cs files.
    All this to say:
    aspx files can't see code behind files - code behind files can't see aspx.designer.cs files
    How can I make Visual Studio 2010 recognize that the code behind files are in fact, the codebehind files?
    • Moved by Alexander Sun Wednesday, January 25, 2012 6:25 AM topic unknown (From:Visual Studio Setup and Installation)
    Tuesday, January 24, 2012 6:12 AM

All replies

  • Hi Sizzelicks,

     

    Per your description, we'd suggest posting your question in one of the ASP.Net forums

    Which located at: http://forums.asp.net

    Hope this would be helpful.

     


    Thanks
    Liam Huang
    EPX Customer Support
    Thursday, January 26, 2012 1:39 AM