Hey There!...
I've been dealing for hours trying to figure out why do I get the
following error message:
Type 'System.Xml.XmlDocument' in Assembly 'System.Xml,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is
not marked as serializable.
I'm using the following method to get the XML:
private XmlDocument loadXmlFile()
{
XmlDocument xmlDoc= new XmlDocument();
try {
xmlDoc.LoadXml(File.ReadAllText(Server.MapPath("~/
links.xml")));
} catch (Exception) {
throw;
}
return xmlDoc;
}
Actually, the method works just fine (it opens the xml file and
returns an XmlDocument with all of the content). But, when the .aspx
page is going to display ... boom! ... i get the error message shown
above.
Does anybody have an idea of how to solve this?
In advance, thanx for your time and help.