There are ViewData and TempData in ASP.
ViewData is mainly controller transmit data to view, the lifetime only one action, to cross action to use TempData,
and TempData depending on tempdataprovider, there will be different lifetime, the Tempdataprovider is Sessionstatetempdataprovider,
You are not mistaken, the assumption is to use the session to store TempData,
The session is not stored by the user, and the time period is 20 minutes?
So Sessionstatetempdataprovider have to do some means, controller up, from the session loaded into TempData, and then delete session, So in action you don't see TempData's session, and when you read TempData, you'll remember to use those keys,
When the controller is finished, the tempdata will be stored back into the session, so the tempdata that have not been read will exist until the session disappears .
tempdata["RouteName"] = RouteName; var routeName = tempdata["routeName"]. ToString (); var Oldpagevaluedto = tempdata["oldpagevaluedto" as pagevaluedto; var olddetail = tempdata["olddetail" as Domesticgeneralfeesdetail;
ASP. NET MVC TempData usage Experience