Share same asp.net pages across multiple web sites?

Posts   
 
    
llblPowa
User
Posts: 41
Joined: 19-Nov-2006
# Posted on: 08-Aug-2007 17:48:05   

Hello Guys,

I am having a common ASP.NET problems (btw - nothing related to llbl) and really can't find a workaround for it, so may be you could help me :-)

I would like to share some common pages (and their logic) through multiple websites :

For example I am having the following web sites:

c:\wwwroot\app1 c:\wwwroot\app2 c:\wwwroot\app3

Theses web sites do have their own "look & feel".

But they will share some pages that are the same, for example the "my basket" page or the "my information page". These common files will use the css rendering of each site (app1, app2 & app3) but will have the same business logic.

Of course, the easiest way is to replicate the common pages into each application, but in doing that, it will quickly become a nighmare in maitenance, as if I change the code for one page, then, I will have to duplicate it across all the other sites.

Any clues?

Many thanks,

LlblPowa.

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 08-Aug-2007 18:36:43   

Have you looked into using ascx Asp.,Net user controls?

http://weblogs.asp.net/scottgu/archive/2005/08/28/423888.aspx has a good discussion, or you can Google it of course?

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 08-Aug-2007 19:33:23   

if it's asp.net 2.0 you can use Themes to control the gui presentation. that way 1 site can have many different layouts.

themes contain Skins (*.skin) and the Skins contian layout and CSS attributes. you could then setup your thems like this MyWebSite App_Themes Theme1 Label.skin Image.skin GridView.skin Theme2 Label.skin Image.skin GridView.skin Theme2 Label.skin Image.skin GridView.skin

in your code behind set the theme on PageLoad

string theme = //get theme from user profile, querystring, session, user input, etc.
this.Theme = theme;
llblPowa
User
Posts: 41
Joined: 19-Nov-2006
# Posted on: 09-Aug-2007 16:50:44   

Thanks you guys for your feedback :-)