By Javier Callico on
7/3/2008
When you try to compile in .Net 2.0 (and up) web pages created using .NET 1.1 and automatically migrated by Visual Studio you may receive an error like this: The name "SampleControl" does not exist in the current context.
If you try to declare the control in your code-behind file you will receive the following error: The type "SamplePage" already contains a definition for "SampleControl".
The solution is very simple - but hard to find - and involves making the Page class partial and moving all control declarations to a .designer file.
This can be done automatically with the following steps:
1- Right click on the .aspx file for the codebehind file that doesn't compile.2- Choose the 'Convert to Web Application' option.This will create a .designer file, and the page will compile.
...