Download content from Session in a class

Asked

Viewed 69 times

0

I have a website that works like this. It has 6 steps. Routes, Air, Hotels, Services, Summary and Payment. Every step of this, I record in a Sesssion. After choosing each product on Session, another Session is created and passed on. Well, in the summary step, I have my shopping cart there. I created a cart class, with the properties referring to each relevant item in each step, type: Idroteiro, Idaereo, Valoraereo, Valorhotel, Idhotel, Dataroteiro, Dataaereo and so on. Now, how do I disable each Sesssions item in the Cart class property? What would be the best way?

So I still have a lot of doubts about it. I know it’s primary for some, but I doubt it. As it is a step-by-step, I need in the next step to pick up some information, which is in a type Hidden in the previous cshtml. I understood what reiksiel said, but I still complicate myself with easy things. Lack footprint.

1 answer

2

Now, how do I download each Sesssions item into the Cart class property? What would be the best way?

Supposing you serialized the entire class in Sesssion that way:

Session["IdCarrinho"] = carro;

Would something like this:

Carrinho carro = (Carrinho) Session["IdCarrinho"];

Browser other questions tagged

You are not signed in. Login or sign up in order to post.