a.aspx文件如何访问b.aspx文件的session值?
请教啊:
b.aspx文件输出SESSION值
string uid = "x";
if (HttpContext.Current.Session["luid"] != null)
{
uid = HttpContext.Current.Session["luid"].ToString();
}
Response.Write(uid);
Response.End();
HttpWebRequest request = null;
request = (HttpWebRequest)WebRequest.Create(url);
request.AllowAutoRedirect = false;
request.Accept = "*/*";
request.Headers.Add("Accept-Language", "zh-cn");
request.Headers.Add("Accept-Encoding", "gzip, deflate");
request.Headers.Add("x-flash-version", "10,1,85,3");
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)";
request.ContentType = "application/x-www-form-urlencoded";
request.KeepAlive = true;
request.CookieContainer = cookieContainer;
request.Method = "GET";
request.Timeout = 5000;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
StreamReader readStream = new StreamReader(responseStream, Encoding.UTF8);
retext = readStream.ReadToEnd();
readStream.Close();
response.Close();
responseStream.Close();
//a页面
protected void Page_Load(object sender, EventArgs e)
{
session["uid"]="xxx";
}
//b页面
protected void Page_Load(object sender, EventArgs e)
{
string uid=session["uid"].ToString();
Response.Write(uid);
Response.Close();
}