How to reference the same CodeBehind class from multiple .aspx files (and be able to pre-compile the
- by thelsdj
I have a set of aspx pages that each live in their own directory and reference a single aspx.cs code behind file.
This has worked fine previously because I never tried to pre-compile the site. IIS must have individually compiled each aspx, linking them to the contents of App_Code but never referencing more than one aspx at a time.
Now that I'm trying to pre-compile the website using Web Deployment Projects I keep getting errors about the same class being found in multiple assemblies.
I can't just drop the aspx.cs in App_Code and subclass it because it wouldn't be able to find the controls on the .aspx pages when compiling. Maybe I could explicitly define every control on the page in the .cs? But would that allow them to be wired up correctly?
Any other ideas on how I can reference the same Page class from multiple .aspx pages and be able to pre-compile the entire website?