.NET MVC Custom viewengine layout
Asked Answered
W

1

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?
}
Wyler answered 9/10, 2011 at 18:50 Comment(2)
FindView method of what class?Intussusception
@Intussusception it's part of IViewEngine.Extrovert
E
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.

Extrovert answered 16/5, 2012 at 16:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.