I'm having problems serializing data for view state. I am using VS2010 and when I try to add a property to the view state, I get the following error message:
Error serializing value 'System.Collections.Generic.List`1[Access.ARW.Business.Filters.Parameters.Parameter]' of type 'System.Collections.Generic.List`1[[Access.ARW.Business.Filters.Parameters.Parameter, Access.ARW.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].'
I added the [Serializable] attribute above the classes I'm trying to serialize, but I still get this error ... any ideas
Here is a property declaration that is in class A:
private List<Filters.Parameters.Parameter> ReportParameters { get { if (ViewState["ReportParameters"] == null) { ViewState["ReportParameters"] = new List<Filters.Parameters.Parameter>(); } return (List<Filters.Parameters.Parameter>) ViewState["ReportParameters"]; } set { ViewState["ReportParameters"] = value; } }
source share