Is there a way to set the layout from the controller?
have tried:
ViewData["Layout"] = "..." return View("view", Model);
I know it will sound odd with some people....
If your view is a ViewGroup (layout) You can use InflaterService. inflate(id, ViewGroup) and set the ViewGroup, it will set the current child(s) with the content of your xml.
View method has overload to set its master layout something like this
return View ("NameOfView",masterName:"viewName");
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