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?
1 Answer 1
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.
-
Thanks for the response, but the problem mainly is with the backend. The frontend could be touched slightly (probably not at all or only client-side code written in JS) but the underneath backend code will be changed.Seacat– Seacat2012年10月09日 19:45:23 +00:00Commented Oct 9, 2012 at 19:45
-
@Seacat The approach still works; Just have your views call the appropriate
RenderAction
based on whatever you choose to switch by.George Stocker– George Stocker2012年10月09日 20:07:24 +00:00Commented Oct 9, 2012 at 20:07 -
Thanks, let me investigate if this solution can be used in our case.Seacat– Seacat2012年10月09日 20:55:25 +00:00Commented Oct 9, 2012 at 20:55
-
@Seacat It would help to have some code in your problem; right now it's very abstract and hard to answer as written.George Stocker– George Stocker2012年10月09日 21:08:04 +00:00Commented Oct 9, 2012 at 21:08
-
What code are you talking about? Really don't understand. It's the architectural question... How to keep 2 versions of the same site and how to show it to appropriate clients, the same time keeping the url for everyone the same.Seacat– Seacat2012年10月10日 19:47:51 +00:00Commented Oct 10, 2012 at 19:47
UserData
token? Is it stored in a separate cookie? Is it stored server side? If you're able to answer these questions (by editing your question), it'll help give some more context to answer it. As it stands, it can only be answered in the most general terms.