Save the name of the main page in the application settings and override the View method inside the Controller class.
protected override ViewResult View(string viewName, string masterName, object model)
{
return base.View(viewName,System.Web.Configuration.WebConfigurationManager.AppSettings["MasterPageName"], model);
}
Gabriel
source
share