I'm having a asp.net website running live with its specific style and specific content. From that site we've built another site with the same logic (in other projects) but with different style and different content (and different files) in the same solution. We've changed the start options from Default.aspx to the root folder for that second site. Now I want to build a more general site which works for several customers, using the same logic and data layers - but with different style and content.

The current site(s) relies heavily on SQL Server 2008 R2, where most of the content resides - but not all. All of the content could be placed in the database with some work if we need to - especially if we get a more general site.

My idea is to use a different start file for every new customer, such as: Default_Customer1.aspx, Default_Customer2.aspx e t c but I'm far from sure if this is the right way to do it. I don't want to have different solutions for every customer. I know that all of the customers will get all of the compiled code, even if some of the code never will be used by that specific customer (who has its specific needs).

So what do I do? Should I try to use different start options (files) for every customer, as mentioned above, or is there a better way handling different customers in the same solution?


Use the same start file for each customer - having one per customer will lead to confusion. What you need is one database per customer.

Create a "pre-login" step where you take the user name and map it to the correct database. So what you have is one ASP membership database that has everybody's login details. This includes an extra table which maps the user to the correct database. So when someone logs in they get the connection string for the correct database. This means you can't have the same user name for multiple sites though.

The alternative is to use separate sub-domains for each customer:


In this case each sub-domain would have it's own connection string to the database but would mean that you had to deploy the application for each customer though. However, it does mean that you can have the same user name on different sites.

| improve this answer | |
  • A great, and very helpful, answer. I like the fact that I can use the same solution but with a different databases. We already have different databases for the first two customers and have planned for different db's per customer. From what you write, the username must be unique to all of the customers in this setup? Meaning if one customers users have the username "test123" it could only be used once. The next user in a different customer db would have to choose a different username? Thanx for your answer! – Benny Skogberg Apr 17 '11 at 19:44

What you want to do is called Multitenancy and it has several approaches. You may start reading about it in Wikipedia.

Multitenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client-organizations (tenants). Multitenancy contrasts with multi-instance architectures where separate software instances (or hardware systems) operate on behalf of different client organizations. With a multitenant architecture, a software application is designed to virtually partition its data and configuration, and each client organization works with a customized virtual application instance.

Some commentators regard multitenancy as an important feature of cloud computing. But the software industry does not universally accept or support the principle of multitenancy, and this may be a source of competitive differentiation...

| improve this answer | |
  • The article is spot on to what I'm trying to accomplish, even if I asked a slightly different thing. I also found some other useful links in the article - which I will continue to read. Thanx for your effort! – Benny Skogberg Apr 18 '11 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.