G
Guest
Let's say I store a real simple value in the Session as follows
Session["MyName"] = "Alex"
Later, in a different page, I try to do something like
SomeLabel.Text = Session["MyName"]
When I do this, I get a compilation error "CS0029: Cannot implicitly convert type 'object' to 'string'
Is this because an object of any type *could* be stored in there and the compiler insists that I tell it in advance? If so, is this true for any Collection
Alex
Session["MyName"] = "Alex"
Later, in a different page, I try to do something like
SomeLabel.Text = Session["MyName"]
When I do this, I get a compilation error "CS0029: Cannot implicitly convert type 'object' to 'string'
Is this because an object of any type *could* be stored in there and the compiler insists that I tell it in advance? If so, is this true for any Collection
Alex