M
Manit Chanthavong
I've read every and have not been able to make serialize a custom class int
a view state. Does anyone have a good example of how this is done? here is
what I have so far: The code seems to throw an error at:
format.Serialize(writer, Items);
[Serializable]
public class RdButtonList: Control, IPostBackDataHandler
{
protected override object SaveViewState(){
ArrayList Items = new ArrayList();
LosFormatter format = new LosFormatter();
StringWriter writer = new StringWriter();
format.Serialize(writer, Items);
ViewState["Items"] = writer.ToString();
return base.SaveViewState();
}
}
Here is the error I'm getting:
must be marked as Serializable or have a TypeConverter other than
ReferenceConverter to be put in viewstate.
Please help! Thanks,
Manit
a view state. Does anyone have a good example of how this is done? here is
what I have so far: The code seems to throw an error at:
format.Serialize(writer, Items);
[Serializable]
public class RdButtonList: Control, IPostBackDataHandler
{
protected override object SaveViewState(){
ArrayList Items = new ArrayList();
LosFormatter format = new LosFormatter();
StringWriter writer = new StringWriter();
format.Serialize(writer, Items);
ViewState["Items"] = writer.ToString();
return base.SaveViewState();
}
}
Here is the error I'm getting:
must be marked as Serializable or have a TypeConverter other than
ReferenceConverter to be put in viewstate.
Please help! Thanks,
Manit