Architecture – ASP.Net MVC 3: multiple versions of the site without changing of URL, is it possible

Architectureasp.net-mvc

Our website is written in ASP.NET MVC 3 and we want to change a feature in the core functionality of the site.

The problem is not every client can be moved to this new version/format (because of some technical inner restrictions) so it means that we need to keep 2 versions of the same functionality (backend and frontend) simultaneously. We don't want our clients to worry about URLs, so the ideal solution would be keep the same URL but redirect clients to the different versions.

The information about clients is stored in database. So the moment when user (client) logs in we know which version of site we should show.

I'm thinking about routing and areas but I'm not sure if it's possible for example to have 2 areas with the different versions of the same application. Or is it possible to load the assemblies on the fly? After user is logged in we can decide if (s)he should be redirected to the new or old version.

As far as all the clients have been moved to the new version we don't need this system more.

How can I do this in ASP.NET MVC?

Best Answer

We do this very thing at The Motley Fool (TMF) with our DailyFinance and Fool Quotes pages. They both run off of the same codebase, but we utitilze a Custom Theme View Engine to allow the differing sites to have radically different CSS and Markup where needed. For instance, the TMF quotes page has Glassdoor integration, where the DailyFinance site does not.

In the custom Theme view engine, you can specify how you want to theme something, in our case, we use the server domain that the site runs off of, but you could just as easily replace it with the value of a cookie, or what company the user comes from (if you have that data stored in your database).

I would need to see some code or a specific example of what you're trying to do to be able to answer your problem any further.