I want to how to assign the session variable, which is of the type of a class I have define, Here OrderData class. I get error on 'Session["MyOrder"];'
My code snippet it like below. Also as ord will be a reference to the object, Any change to the object will be reflected to the session object?
OrderData ord = new OrderData();
if (Session["MyOrder"] == null)
{
Session.Add("MyOrder", ord);
}
else
{
ord = Session["MyOrder"];
}