Search code examples
c#asp.netvisual-studio-2010code-behind

Codebehind file doesn't recognize aspx-controls


I was given a webproject written with aspx/c#. When I loaded it into Visual Studio 2010, I got many error telling me that some controls in the code-behind files do not exist in the current context.

I checked for the common pitfalls, like wrong code-behind file name, missing runat-attribute, restart VS, reload project, yet nothing resolves the error.

What else can I do to check where the problem is?


Solution

  • Cudos to @03Usr the following link brought the answer:

    ASP.NET controls cannot be referenced in code-behind in Visual Studio 2008

    Deleting all designer files and converting the project als web application brought the designer files back, effectively making the controls referenceable again.