先建立自己定義的類別:
[System.Serializable()]
public class _InfoStudent
{
public ArrayList Name;
public ArrayList Status;
public _InfoStudent()
{
Name=new ArrayList();
Status=new ArrayList();
}
}
完成後,將序列化的資料指派給ViewState
_InfoStudent InfoStudent=new _Infostudent( );
ViewState["test"]=InfoStudent;
從ViewState取資料
InfoStudent=(_InfoStudent)ViewState["test"];
沒有留言:
張貼留言