开发者

mutlitenant asp.net mvc 2 - domain to area routes

开发者 https://www.devze.com 2023-01-20 23:15 出处:网络
I\'m starting a new project which in simple terms will have a UI layer based on asp.net mvc 2, a business layer and a data access layer. Simple 3-tier design.

I'm starting a new project which in simple terms will have a UI layer based on asp.net mvc 2, a business layer and a data access layer. Simple 3-tier design.

The UI layer though will be customized for the client, e.g. menus along the top, or down the left or maybe different static pages, etc. All the core features will be the same across the multiple clients but some clients may have more or less features available to them.

I'm thinking of using Areas in one single asp.net mvc project to separate the clients. So as I add clients I will add areas - is this a good approach? If I follow this approach can I share controllers? but have the controller route to the correct view within the area?

Also if I deploy my site to mynewsite.com - each area is going to be accessible at mynewsite.com/area1, mynewsite.com/area2 and so on. But if a client would like their own domain, what is the best way of achieving this? so that www.clientdomain.com -> mynewsite.com/area1 and clientdomain.com/products/list is the same as mynewsite.com/area1/products/list - would I have to handle this through the HTTP Url Routing on the server?

Hopefully I've explained my situation ok! Many thanks for开发者_StackOverflow any feedback.


Just for information - I decided against using areas in the end and I have simple client configuration component with custom view engine that I put together to swap out the views per client (using domain name and/or when the user logs in). The views are currently held in client specific folders and I only put the views I need to change for a client into those folders, if the view engine cannot find the view in the client specific folder it will revert back to the default views, which is pretty much the normal case as 90% of the client specific changes are done with CSS.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号