A bit of Architecture advice.. One code.. Multiple sites

A

anthonykallay

Hi there,

I am building a website for a group that has 4 companies under it. The
sites are fairly similar so i want to be able to use the same set of
code in the App_Code folder.. I also want to share controls between
the sites. What i am after is a bit of advice as to best practice to
achieve this. Obviously this seems to be a good use of themes so i
will do this to use diffrerent colours where appropriate.. My main
concern is how to differentiate between the sites on any page load so
the correct logo and theme is used.

1) What variable is best to store the current site id in so that it
can be accessed by all pages??

2) Is there a way that all sites can appear to be at the root of the
folder, one method i thought as to have the main page redirect to a
folder in the main app (ie www.website1.co.uk would redirect to root/
website1/) but i dont really want this to happen, is there a way to
mask this folder so it appears that the website1 folder is at the root
of the address bar would i use reg ex for this??

Sorry if this sounds confuing but any advice would be greatlty
appreciated

Anthony
 
E

Eliyahu Goldin

1) What variable is best to store the current site id in so that it
can be accessed by all pages??

A more elegant solution would be to have all customizable settings in a
single xml file Companies.xml with an xml node for every company. The users
will be redirected to something like Start.aspx?companyId=1. The Start.aspx
will get the company parameters from Companies.xml and apply them to the
current session.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
M

Mark Rae [MVP]

A more elegant solution would be to have all customizable settings in a
single xml file Companies.xml with an xml node for every company. The
users will be redirected to something like Start.aspx?companyId=1. The
Start.aspx will get the company parameters from Companies.xml and apply
them to the current session.

Yes definitely.

I do this for a whole group of my clients (musical groups, in this case)
whose websites I maintain. Each website has a "Login" button which redirects
to a single secure site and passes an encrypted QueryString containing the
client identifier. Each client has a profile stored in SQL Server and, when
the site first opens, it reads in and decrypts the client identifier and
then selects the client's individual MasterPage. Each client has a
completely seperate MasterPage, CSS etc which means that there is only one
actual site which is customised for each individual client.
 
A

anthonykallay

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,734
Latest member
manin

Latest Threads

Top