C# session 存不了Table
执木 2012-05-14 09:40:22 if (Session["table"] !=null)
{
Table mytable = (Table)Session["table"];
mytable.Rows.Add(myRow);
Session["table"] = mytable;
int temp = (int)Session["INT"];
temp += 1;
Session["INT"] = temp;
}
else
{
Table tmptable = new Table();
tmptable.Rows.Add(myRow);
Session["table"] = tmptable;
Session["INT"] = 1;
}
Table stb = (Table)Session["table"];
foreach (TableRow tmptr in stb.Rows)
{
Table1.Rows.Add(tmptr);
}
问题补充:
每次点击按钮执行到这里 session里的table.rows.count 都等于0 不知道为什么存不住