tags:

views:

139

answers:

2

I have a series of .NET 2.0 web pojects that have identicle code behind in their web pages. The only thing that is different is how the html is laid out.

Is there a way that I can have a main web project that holds all the code behind (including control events like button click) and so that the other web projects reference the web page code file to this project's code files?

Edit: Note that the changes in html include exclution of certain controls, I am catoring for this by using the FindControl method so that if the control doesnt exists, I would simply have a null value.

+3  A: 

You may try putting all the code-behind classes into a library and inheriting from a common base-class.

Zahir
But then I would lose events like page load, no?
Drahcir
Nevermind, worked as you said
Drahcir
A: 

You can take a look at "Skin File" file type of Visual Studio. On the other hand you can learn if it works for you from the address below:

http://msdn.microsoft.com/en-us/library/ykzx33wh(VS.80).aspx

Enes
Thing is that the html varies as in as to where the controls are laid out and some of them might not necessarily be included
Drahcir