I'm building an MVC application. One of my taskS is to build a store. I set up a "wizard" like set of views that brings the user to fill different kind of data until the end of the operation, in total 7 steps.
My issue is about how to share some data between all these views.
First I used old-fashioned Session
and everything worked on my desktop, but when I finally deployed my application into my company's hosting server I got exceptions because Session
was erased randomly during some steps.
Now I modified everything to set up any data I need inside TempData
, and refreshing all data in each step and it's seems to work properly.
I'm a little confused!
My confusion is about all these structures: Session (I know it coming from asp.net), ViewData
, TempData
and the magic ViewBag
.
I read a lot about but I need someone that clearly tell me what is more appropriate for me in this case.