I want to store some basic user details in a Session variable (first name, last name, join date, etc) and thought it would be easier to put them into a structure rather than holding them in separate variables.
Is this possible?
How do I do it?Hi,
You can put in Session anything that inherits from System.Object. In .NET it is virtually everithing (except interfaces and delegates) including structures. Having structure str you can do it like this:
Session("MyStruct") = str
Thanks.
If I subsequently want to delete the structure from the Session, can I just set Session("MyStruct") = null ?
Will this release all the individual components of the structure in one go?
Yes
0 comments:
Post a Comment