I don\'t know how to using dynamic master page in ASP.NET MVC RC 1.0. Please help!
I got this to work by creating a base controller that handled the OnActionExecuted event. In the OnActionExecutedevent I assign the master page. Then I made all my other controllers inherit from the base class.
public class BaseController : Controller
{
protected override void OnActionExecuted(ActionExecutedContext filterContext) {
var action = filterContext.Result as ViewResult;
if (action != null) {
action.MasterName = MyApp.Properties.Settings.Default.Theme;
}
base.OnActionExecuted(filterContext);
}
}
I wrote a post about this if you want more detail