S
Steven
Hello,
In my asp.net application, I have the MainForm.aspx.cs (where all the
functions are defined) and ClasssificationInfo.cs class. This is the
Classification Info class --
using System;
using System.Xml.Serialization ;
namespace MyAppl
{
[XmlInclude(typeof(ClassificationInfo))]
public class ClassificationInfo
{
public string Name1 ;
public string Name2 ;
public string Name3 ;
public ClassificationInfo()
{
Name1 = "";
Name2 = "" ;
Name3 = "" ;
}
}
}
In my MainForm class I declared this: public ClassificationInfo
oClassificationInfo = new ClassificationInfo() ;
Whenever a user clicks a button on the page, I will collect all the
information from the textboxes (Name1, Name2, Name3) and store in a
Temporary arraylist and then I store it in the session. On the dispose
event, I'm serializing the data like this...
public void SerializeData()
{
string FiletoSave = @"C:\Temp\Classification.xml";
StreamWriter sw = new StreamWriter(FiletoSave, true);
ArrayList ToSerializeList = new ArrayList() ;
ToSerializeList = (ArrayList) this.Page.Session["CollList"] ;
XmlSerializer TheXMLSerializer =new XmlSerializer(typeof(ArrayList)) ;
TheXMLSerializer.Serialize(sw, ToSerializeList);
sw.Close() ;
}
When I run this code, I'm getting error saying:
The type MyAppl.ClassificationInfo was not expected. Use the XmlInclude or
SoapInclude attribute to specify types that are not known statically.
How should I solve this problem?
Any help would be greatly appreciated.
Thanks
Steven
In my asp.net application, I have the MainForm.aspx.cs (where all the
functions are defined) and ClasssificationInfo.cs class. This is the
Classification Info class --
using System;
using System.Xml.Serialization ;
namespace MyAppl
{
[XmlInclude(typeof(ClassificationInfo))]
public class ClassificationInfo
{
public string Name1 ;
public string Name2 ;
public string Name3 ;
public ClassificationInfo()
{
Name1 = "";
Name2 = "" ;
Name3 = "" ;
}
}
}
In my MainForm class I declared this: public ClassificationInfo
oClassificationInfo = new ClassificationInfo() ;
Whenever a user clicks a button on the page, I will collect all the
information from the textboxes (Name1, Name2, Name3) and store in a
Temporary arraylist and then I store it in the session. On the dispose
event, I'm serializing the data like this...
public void SerializeData()
{
string FiletoSave = @"C:\Temp\Classification.xml";
StreamWriter sw = new StreamWriter(FiletoSave, true);
ArrayList ToSerializeList = new ArrayList() ;
ToSerializeList = (ArrayList) this.Page.Session["CollList"] ;
XmlSerializer TheXMLSerializer =new XmlSerializer(typeof(ArrayList)) ;
TheXMLSerializer.Serialize(sw, ToSerializeList);
sw.Close() ;
}
When I run this code, I'm getting error saying:
The type MyAppl.ClassificationInfo was not expected. Use the XmlInclude or
SoapInclude attribute to specify types that are not known statically.
How should I solve this problem?
Any help would be greatly appreciated.
Thanks
Steven