help - serilization

  • Thread starter Thread starter mortb
  • Start date Start date
M

mortb

I have a class that I want to serialize to into the viewstate of an aspx
form.
I've specified the [Serializable] attribute on top of the class definition,
compiled but when I browse the page I get an excepiton that the class must
be marked as Serializable.
Can this have something to do with some of the members not beeing of
serializable types? I thought it would be neat to put my custom object in
the viewstate. How do I solve this?
Does anyone have a link that provides me with some in depth information
about this?

cheers,
mortb
 
mortb,

That's exactly what it is. When you mark your class as serializable,
every field must be marked as serializable as well. If you want to indicate
that certain members of your class should not be serializable, then you can
adorn them with the NonSerialized attribute.

Hope this helps.
 
Back
Top