I've recently inherited a fairly large web site. The project is set up as a web site in Visual studio, and not a Web Application. For a number of reasons, I would like to convert it to a web application.
I started converting the application using these directions from Scott Gu: Migrating a VS 2005 Web Site Project to VS 2005 Web Application Project.
While doing the conversion I discovered that this web site uses a ton of #include directives to include other .aspx files. The main problem with this is that currently each code-behind file directly calls controls (using this.) from the pages it is including.
This behavior seems to be allowed by the way that the compiler dynamically creates the .designer files in memory at compile time.
The problem is that since I'm converting the application to a Web Application, I'm creating physical versions of the .designer files. Now the same call to controls on the included pages (using this.), no longer work.
I've tried a few things to try and remedy this:
First, I noticed that the .aspx include files didn't have a @ Page directive, so I tried adding one. This prevented the app from compiling because the main page now had multiple @page directives.
Second, I tried to just rename the included .aspx files to .inc, but I still have the same problem of the main page no longer being able to access the controls as they could before.
Anyone ever done this before and have any thoughts on how to proceed without changing the entire structure of the web site?
edit: I decided not to go through with the conversion at this time simply because any benefits gained wouldn't be worth the trouble. Thanks for the help.