Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Persistence in WebParts
Message
From
18/08/2006 12:37:18
 
General information
Forum:
ASP.NET
Category:
Class design
Environment versions
Environment:
C# 2.0
Database:
MS SQL Server
Miscellaneous
Thread ID:
01146511
Message ID:
01146787
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
Chad,

>Will I have to write special serialization/decoding code to make that happen?

Oh wow, like I said, it's been awhile since I've done this. <g> I'm not 100% sure if you have to make it serializable or not ... I *think* you don't have to, but I could be wrong.

If you need to make your object serializable, all you need to do is add the attribute to your class ... something like this:
[Serializable()]
public class CustomObject 
{
}
I think when I played with this before, I only "saved" our Typed DataSets to the session object, and they were all serializable anyway.

~~Bonnie



>Bonnie,
>
>Can any object be stored to a Session object and retrieved back as that object:
>
>Session["MyObject"] = myCustomObject;
>
>
>CustomObject myCustomObject = (CustomObject)Session["MyObject"];
>
>Will I have to write special serialization/decoding code to make that happen?
>
>TIA,
>Chad
>
>>Hi Chad,
>>
>>I haven't done much with Web apps lately, but when I was messing around with them a couple years back, I determined that the best way to persist data was with Session objects.
>>
>>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform