G
Guest
I have a class that inherits from CollectionBase
The class is marked as Serializable and implements ISerializable. It has a
constructor overload for deserialization also.
CollectionBase holds a class which also is marked as Serializable and
implements ISerializable and also has a constructor overlaod for
deserialization.
I am getting the CollectionClass must be marked as Serializable or have a
TypeConverter other than ReferenceConverter to be put in viewstate.
I have set breakpoints and the GetObjectData is called for both the
CollectionClass and its items. 7 items, 7 calls. However when it exits the
CollectionClass GetObjectData it throws the exception.
I have tried 2 methods of serializating. I just went ahead and
AddValue(this.List); and I have also puyt them in manually 1 item at a time
by myself using a for loop and "Item" + i.ToString(). Both resulted in the
same execution and the same Exception.
Is there something that I am missing that is causing it not to beable to be
saved in the WebPage's ViewState?
Interestingly enough I am having this SAME problem in asp.net 2.0 however it
is capable of serializing the list. Every item that is in the deserialized
list is NULL.
http://www.codeproject.com/aspnet/Strongly_typed_collection.asp
http://www.dotnet247.com/247reference/msgs/45/228617.aspx
I found these samples both of which have similar problems and went ahead I
implemented the same generic TypeConverter that they do, however this did
not solve my woes.
I assume this has to be something pretty obvious that I am missing but for
the life of me I can't seem to find it.
The class is marked as Serializable and implements ISerializable. It has a
constructor overload for deserialization also.
CollectionBase holds a class which also is marked as Serializable and
implements ISerializable and also has a constructor overlaod for
deserialization.
I am getting the CollectionClass must be marked as Serializable or have a
TypeConverter other than ReferenceConverter to be put in viewstate.
I have set breakpoints and the GetObjectData is called for both the
CollectionClass and its items. 7 items, 7 calls. However when it exits the
CollectionClass GetObjectData it throws the exception.
I have tried 2 methods of serializating. I just went ahead and
AddValue(this.List); and I have also puyt them in manually 1 item at a time
by myself using a for loop and "Item" + i.ToString(). Both resulted in the
same execution and the same Exception.
Is there something that I am missing that is causing it not to beable to be
saved in the WebPage's ViewState?
Interestingly enough I am having this SAME problem in asp.net 2.0 however it
is capable of serializing the list. Every item that is in the deserialized
list is NULL.
http://www.codeproject.com/aspnet/Strongly_typed_collection.asp
http://www.dotnet247.com/247reference/msgs/45/228617.aspx
I found these samples both of which have similar problems and went ahead I
implemented the same generic TypeConverter that they do, however this did
not solve my woes.
I assume this has to be something pretty obvious that I am missing but for
the life of me I can't seem to find it.