ASP.NET MVC – Dynamically Changing The Master Page (Theming)

added by daniewat82
1/31/2010 6:14:18 PM


In the last two weeks I have seen this technique spoken about twice! It is a hot topic at the moment…. how do you have multiple themes for an ASP.NET MVC web application and then set the desired theme dynamically? There are multiple ways to implement this and in this post I will explain my preferred method. I like to have multiple master pages with each master page linking to its own set of assets and styles, then dynamically changing the master page used based on a route parameter.