我通过静态页传参,在a.aspx的Page_Load()中实现登录,并把相关信息保存在session中,用Response.Redirect(path)跳转后,session中的值丢失。但session的id并没有改变,请高人解决!!
代码:
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面

string UserName = Request.Params["username"].ToString();
string UserPass = Request.Params["username"].ToString();
string path = Request.Params["path"].ToString();
if(!IsPostBack)
{
UserInfo user=new UserInfo(UserName,UserPass);
int n = user.new_ValidateUser();
if(n == 0)
{
Session.Remove("LoginSession");
Session["LoginSession"]=user;
}
Response.Redirect(path); }
}