Click to See Complete Forum and Search --> : How to save a object into session?


Bill white
December 26th, 2001, 10:05 AM
I created a business logic object in a aspx files, and I saved it into a session variable.
I want to retired the object in round trip, but it failed. why?

asp can do it. but aspx can't. why?

when I saved a string or integer into session in aspx file, it's OK.

Please help me.

thanks.

manbaum
December 30th, 2001, 02:04 AM
say, if your class defined as follow:


class MyObject
{
// ... your business logic ...
};




and, if you want to save an instance of MyObject into Session,
just add single line to your class definition, like:


[ISerialiable]
class MyObject
{
// ... your business logic ...
};




Try it :)


-=[ Manbaum ]=-
If helps U, thanks for rating :-)

manbaum
January 5th, 2002, 04:35 AM
sorry for my misspelling.

you should change "ISerialiable" to "Serializable"


-=[ Manbaum ]=-
If helps U, thanks for rating :-)