views:

175

answers:

2

During runtime, is there a way to specify which MasterPageFile a view should use?

Basically when the view is rendered I need to tell it which Master Page File to use which may be obtained from a database or something.

+1  A: 

It's OK I found it. There is an overide in the View() method that takes a master page as an argument.

return View("Index","~/Views/Shared/Site.Master");
griegs
A: 

Duplicate: http://stackoverflow.com/questions/630833/how-to-use-dynamic-master-page-in-asp-net-mvc-rc-1-0/692231#692231

John Sheehan
Thanks John. Sometimes it's all about the keywords you search on. :)
griegs