Reputation: 2818
What is the best approach to keeping two separate sets of views in one application?
I need to create two websites which have different frontend layouts, but have almost identical code base (admin area, controller logic, etc). There are supposed to be two build configurations that decide which layout to use.
Upvotes: 0
Views: 50
Reputation: 239270
If the only difference is which layout will be used. You could set this as an AppSetting in your Web.config and then create different configurations for each site. In Views\_ViewStart.cshtml
you can pull the layout path from ConfigurationManager.AppSettings
. When publishing, you simply choose which configuration you want to publish, and then use the configuration-specific web.config transform to change the AppSetting appropriately.
Upvotes: 0