G
Guest
I have a class that is a control derived from UserControl. I want to use
serialization and deserialization with this calss but I get an exception
"Cannot serialize member System.ComponentModel.Component.Site of type
System.ComponentModel.ISite because it is an interface.".
I am not interested in serializing any member from the base class only the
properties in the derived class.
How can I prevent the entire base class from being serialized?
Code snippet
public partial class UserControl1 : UserControl
{
private int item1;
private string item2;
public UserControl1()
{
}
public int Item1
{
get {return item1;}
set {item1 = value;}
}
public string Item2
{
get { return item2; }
set { item2 = value; }
}
}
public partial class Form1 : Form
{
private UserControl1 Uctrl1;
serialization and deserialization with this calss but I get an exception
"Cannot serialize member System.ComponentModel.Component.Site of type
System.ComponentModel.ISite because it is an interface.".
I am not interested in serializing any member from the base class only the
properties in the derived class.
How can I prevent the entire base class from being serialized?
Code snippet
public partial class UserControl1 : UserControl
{
private int item1;
private string item2;
public UserControl1()
{
}
public int Item1
{
get {return item1;}
set {item1 = value;}
}
public string Item2
{
get { return item2; }
set { item2 = value; }
}
}
public partial class Form1 : Form
{
private UserControl1 Uctrl1;