I am working with the new ASP.NET MVC areas and mixing it with themes. In MVC without areas I used to apply themes by adding
<pages theme="ThemeName" ... > ... </pages>
to the Web.Config in the Views folder, and it worked perfectly. Now that I have an Areas folder, each with its own Web.Config, my theme is only applying to controllers in the non areas controllers (which makes perfect sense). I would like to change the default theme in a single Web.Config, but the only one which encompasses all my folders is in the root, which causes an error when you hit the Default.aspx page.
EDIT: In ASP.NET MVC 2, it turns out they removed the Default.aspx page in the root of the website, making it so you can now specify the theme in the root Web.Config without a problem and it applies to areas as well due to the folder structure.
Aside from this, I don't understand how "themes don't necessarily sit well in the MVC paradigm" either. A major concept in MVC is separation of concerns through layers of abstraction. I don't see any reason why the view can't be abstracted to two separate entities, the data displayed at given point in a user interface and the theme that data is styled to.
I have two questions:
- Is it possible to specify the theme in a single Web.Config for this type of project? [Solved in edit.]
- Why don't themes sit well in the MVC paradigm?