I
itaitai2003
Within my Web User Control code I'm trying to store a class in the
ViewState and retrieve the class upon postback. However I get a cast
exception.
[Serializable]
{
public string x1;
public string x2;
public string x2;
}
MyClass c;
ViewState.Add("Test",c)
Withing Page_Load:
If(Page.IsPostback)
{
MyClass c = (MyClass)ViewState["Test"]
}
ViewState and retrieve the class upon postback. However I get a cast
exception.
[Serializable]
{
public string x1;
public string x2;
public string x2;
}
MyClass c;
ViewState.Add("Test",c)
Withing Page_Load:
If(Page.IsPostback)
{
MyClass c = (MyClass)ViewState["Test"]
}