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?
}
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With