7

In a custom viewengine in the FindView method, how can I see the Layout used? masterName is always empty.

ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) {
    // How do I get WebViewPage.Layout to know what layout is used?
}
Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
jaap
  • 373
  • 6
  • 15

1 Answers1

3

Unless you are setting your master at the controller level with return View(string viewName, string masterName), the masterName will always be empty. The master is typically determined during the compilation of the view itself.

Nathan Taylor
  • 24,423
  • 19
  • 99
  • 156