Reputation: 7979
How can i set tempdata in from Global.asax?
asp.net-mvc-2
Upvotes: 0
Views: 1558
Reputation: 7979
Dictionary<string, object> tempDataDictionary = Context.Session["__ControllerTempData"] as Dictionary<string, object>;
if (tempDataDictionary == null)
{
tempDataDictionary = new Dictionary<string, object>();
}
**tempDataDictionary["TopMessage"] = message;
tempDataDictionary["FromUnauthorized"] = true;
HttpContext.Current.Session["__ControllerTempData"] = tempDataDictionary;**
Server.ClearError();
Response.Redirect("~/Account/LogOn");
Upvotes: 4