B
Ben Amada
I've created a class that I need to store in ViewState. However when I try
to store it in ViewState, I get the following error:
"The type 'solution.pe2' must be marked as Serializable or have a
TypeConverter other than ReferenceConverter to be put in viewstate."
I've included the <Serializable()> attribute, but I'm still getting the same
error.
The class is below ... as you can see it contains a Collection, two
Hashtables and an Enum.
How can I make this class and all of its contents serializable so ViewState
can store it??
TIA, Ben
-----------------------------------------
<Serializable()> Public Class pe2
Implements IEnumerable
Private m_colChildren As New Collection
Public Style As New Hashtable
Public Attributes As New Hashtable
Private m_strID As String
Private m_enumElementType As ElementType
Public Enum ElementType
Span
Div
Image
End Enum
Public Function GetEnumerator() As _
System.Collections.IEnumerator Implements _
System.Collections.IEnumerable.GetEnumerator
Return m_colChildren.GetEnumerator
End Function
End Class
to store it in ViewState, I get the following error:
"The type 'solution.pe2' must be marked as Serializable or have a
TypeConverter other than ReferenceConverter to be put in viewstate."
I've included the <Serializable()> attribute, but I'm still getting the same
error.
The class is below ... as you can see it contains a Collection, two
Hashtables and an Enum.
How can I make this class and all of its contents serializable so ViewState
can store it??
TIA, Ben
-----------------------------------------
<Serializable()> Public Class pe2
Implements IEnumerable
Private m_colChildren As New Collection
Public Style As New Hashtable
Public Attributes As New Hashtable
Private m_strID As String
Private m_enumElementType As ElementType
Public Enum ElementType
Span
Div
Image
End Enum
Public Function GetEnumerator() As _
System.Collections.IEnumerator Implements _
System.Collections.IEnumerable.GetEnumerator
Return m_colChildren.GetEnumerator
End Function
End Class