I am using MVC 3 with the Razor view engine. I want to set some values in the ViewBag inside a Partial View and want retrieve those values in my _Layout.cshtml. For exampl
The partial view gets its own ViewBag.
ViewBag
You can get the page's ViewBag from ((WebViewPage) WebPageContext.Current.Page).ViewBag
((WebViewPage) WebPageContext.Current.Page).ViewBag