asp.net页面传递参数的另一种用法 HttpContext.Current.Items

--------- 页面A -----------

HttpContext.Current.Items.Add("A",  a.Text);

HttpContext. Current. Items. Add("B",  b.Text);

HttpContext.Current.Items.Add("C",  c.Text);


this.Server.Transfer("B.aspx");


------- 页面B -----------------

string strA  = HttpContext.Current.Items["A"].ToString();
string strB = HttpContext.Current.Items["B"].ToString();
string strC = HttpContext.Current.Items["C"].ToString();





你可能感兴趣的:(asp.net页面传递参数的另一种用法 HttpContext.Current.Items)