Hi, I need some help understanding nested master pages. From reading I understand why you would do this but I think my requirement is a bit different.
I have a single solution in VS 2008 using themes, a root master page and misc content pages, This solution is setup to allow me to deploy a number of websites using the same code, but different database content, different database connections and so on. all of the logic of these sites is the same, its the layout that needs to be different. I setup a theme folder for each website using the websites name. For development I have a app setting for the name of the site I want to run at that time and then I change the global theme based on this setting.
The next thing I want to do is keep the root master page that contains all the coding for the site in the code behind ( so i dont have duplicate code), but what is different for each site is the site layout. so I was thinking on using a nested masterpage that is changed based on my appsetting in the web.config file. I can name the 2nd master page website1.master, website2.master and they will have a matched theme with the same name.
So at runtime I get the value of the website name in app settings, set the global theme then set the root masterpage to grab the layout from my 2nd masterpage located in a folder on the site. From here I want to be able to run a content page and have it displayed inside.
Ive already setup 2008 deployment that allows me to only copy the files I need for each site and the webconfig settings for that site to deploy the sites individually. Thats great for deployment but I want to be able to run the different sites in my development environment based on the app setting. This is how the project looks
MyProject
.....App_Code
.....Bin
.....App_Themes
..........Site1Theme
...............default.css
...............default.skin
...............web.config - specific settings for this site, connection strings, email etc
...............default.master - specific layout for this site
.....Site2Theme
default.aspx
default.master - no layout just site logic
web.config - config info for all sites
The web.config and default master are in the theme folder just so everything is in one place, if this cause compile issues I can move them elsewhere.
Am I making sense here? if I create say an about page in the root, I want it to automatically use the master page from the site im running based on the appsetting in the root web.config file.
Thanks
-Keith
My Site PopcornSupply - popcorn machinesASP.NET 2.0, ASP, SQL server development