A
antonyliu2002
I think it is a bad idea to implement session as a bag of string pairs.
That is, it is not a good idea to force both a key and its value to be
of type String.
It has no problem for most web controls. For example, for TextBox(es),
we can have the following in the session bag:
"txtFirstName": "John"
"txtLastName": "Doe"
But, the current session implementation is not handy when we have to
store ListItem(s) of a multiple ListBox.
For example, if I have on my web this multi-select ListBox (whose ID is
lstbxFood):
Select your favorite food:
Hamberger
Pizza
Icecream
French Fries
Yogurt
And suppose, a user selects the first 3 items: Hamberger, Pizza and
Icecream.
Then, we have a little problem storing in the session all 3 selected
items for the key "lstbxFood".
So, it would be nice if the value of a key in the session can be some
kind of container which can hold multiple objects.
What do you think?
That is, it is not a good idea to force both a key and its value to be
of type String.
It has no problem for most web controls. For example, for TextBox(es),
we can have the following in the session bag:
"txtFirstName": "John"
"txtLastName": "Doe"
But, the current session implementation is not handy when we have to
store ListItem(s) of a multiple ListBox.
For example, if I have on my web this multi-select ListBox (whose ID is
lstbxFood):
Select your favorite food:
Hamberger
Pizza
Icecream
French Fries
Yogurt
And suppose, a user selects the first 3 items: Hamberger, Pizza and
Icecream.
Then, we have a little problem storing in the session all 3 selected
items for the key "lstbxFood".
So, it would be nice if the value of a key in the session can be some
kind of container which can hold multiple objects.
What do you think?