L
leal ting
a class inherited from ArrayList,
is saved to ViewState,
why the type of the object read from ViewSate is not the class,
but the parent, ArrayList
[my email address (e-mail address removed)]
the class inherited from ArrayList
public class Fields: ArrayList
{
public Fields()
{}
}
Save to ViewState
this.ViewSate["FieldList"] = colFields;
when reading, it raises an error,
Fields colFields = (Fields)this.ViewSate["FieldList"]
the right type
ArrayList colFields = (ArrayLiist) this.ViewState["FieldList"];
why? how to solve it? and how to read it directly?
is saved to ViewState,
why the type of the object read from ViewSate is not the class,
but the parent, ArrayList
[my email address (e-mail address removed)]
the class inherited from ArrayList
public class Fields: ArrayList
{
public Fields()
{}
}
Save to ViewState
this.ViewSate["FieldList"] = colFields;
when reading, it raises an error,
Fields colFields = (Fields)this.ViewSate["FieldList"]
the right type
ArrayList colFields = (ArrayLiist) this.ViewState["FieldList"];
why? how to solve it? and how to read it directly?