I've been working with TempData
lately and facing a confusing case:
Supposing that the TempData
is created in the following Action:
public ActionResult MyAction1()
{
//...
myTempData = TempData["myTempData"];
//..
}
and is expected to be use in the following Action:
public ActionResult MyAction2()
{
//...
TempData["myTempData"] = myTempData;
//..
}
I understand that if I call MyAction2
on the next request, the TempData
value will be deleted. But if I call other action, not MyAction2
, on the next request, will TempData
be deleted? If it will be, is there any trick to make sure it exist until the end of the session?
Thanks all.