In asp.net MVC 3 is there a way to override the Layout declaration set in a view from a controller or action filter?
@{ Layout = \"~/Views/Shared/_Layout.cshtm
Use ViewBag when you need to change the layout call an action and put the new layout (even null) in viewbag.
@{ Layout = ViewBag.layout; }
and inside the action
if(something) ViewBag.layout = "~/Views/Shared/whatever.cshtml"; else ViewBag.layout = null;