日期:2014-05-17 浏览次数:20511 次
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(string)); for (int i = 0; i < 10; i++) { dt.Rows.Add(i.ToString()); } Cache["Table"] = dt; } else { DataTable dt = Cache["Table"] as DataTable; dt.Rows[2]["Id"] = "这是我修过过的ID"; //重新保存到cache中 Cache["Table"] = dt; } }