XmlDocument and ViewState.

  • Thread starter Thread starter Be_Gomes
  • Start date Start date
B

Be_Gomes

My greetings to all...

Can anyone help me with this:
I'm trying to put a XmlDocument in the viewstate of a
page, but I'm having the following error to my request:

The type 'System.Xml.XmlDocument' must be marked as
Serializable or have a TypeConverter other than
ReferenceConverter to be put in viewstate.

How can i make the xmldocumet serializable?
Do I have to make a class MyXMLDocument, for instance,
make it serializable and inherit it from the XmlDocumet?

Any other ideas on solving this?

Thanks in advance....

Be.
 
I would just store the XML in the document in viewstate, and then
reinitialize an XmlDocument with it's contents after you pull it out.
 
Back
Top