Search code examples
asp.net-mvctempdata

TempData from Global ASAX


Can someone post a sample code on how I can access the TempData dictionary object from within the Global.asax.cs?


Solution

  • Dictionary<string, object> tempDataDictionary = HttpContext.Current.Session["__ControllerTempData"] as Dictionary<string, object>;