I have the default _ViewStart.cshtml in my /Views folder. I\'d like to be able to access my ViewBag object so I can set the default title for all my views.
However,
hmm, you can access ViewBag via ViewData, e.g. ViewContext.ViewData["Title"].
So if you set ViewBag data in an action filter for example, you can pull it out from _ViewStart.cshtml using ViewContext.ViewData["Title"].
But I tried to assign a value using ViewContext.ViewData["Key"] = value; and it doesn't seem to persist to the actual view.