views:

54

answers:

1

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

Thanks in advanced...

+1  A: 
Dictionary<string, object> tempDataDictionary = httpContext.Session["__ControllerTempData"] as Dictionary<string, object>;
jfar
Thanks, jfar. Your answer helped me get it right, but it is not 100% correct as there is some compile time errors with it. I used HttpContext.Current.Session instead of httpContext.Session, please edit your response so people can use it in the future.
Jonas Stawski