I am working on asp.net with mvc 4 architectute. Here i have two controller Display and SessionEx. In Display Controller i have an method like below
public ActionResult SessionExample()
{
TempData["FortheFullRequest"] = "FortheFullRequest";
string v = Session["Session1"].ToString();
ViewData["Myval"] = "ControllertoView";
ViewBag.MyVal = "ControllertoView";
Session["Testing1"] = "Testing Session";
return RedirectToAction("SomeOtherAction", "SessionEx");
}
In the SessionEx controller i have the method as below
public ActionResult SomeOtherAction()
{
string str1 = Convert.ToString(Session["Testing1"]);
string str2 = Convert.ToString(TempData["FortheFullRequest"]);
return View();
}
I am debugging the project and i have also used watch to look at the gets stoted in tempdata and session. In the start the appropriate value in both session and tempdata but when the cursor reaches at RedirectToAction method all values gets stored in session and tempdata becomes null.Please help me someone here.