现在按钮里仅仅写了这点信息
private void btn_login_Click(object sender, System.EventArgs e)
{
if(this.tbx_uid.Text=="admin" && this.tbx_upassword.Text=="111")
{
Session["uid"].ToString()=this.tbx_uid.Text; System.Web.Security.FormsAuthentication.SetAuthCookie(this.tbx_uid.Text,false);
Response.Redirect("../UserInfo.aspx");
}
}
private void btn_login_Click(object sender, System.EventArgs e)
{
if(this.tbx_uid.Text=="admin" && this.tbx_upassword.Text=="111")
{
Session["uid"].ToString()=this.tbx_uid.Text; System.Web.Security.FormsAuthentication.SetAuthCookie(this.tbx_uid.Text,false);
Response.Redirect("../UserInfo.aspx");
}
}
框架名叫leftframe
在其它的页面取的时候
string uid = Session["uid"].ToString();
lbl_userId.Text = uid;
取出来就赋给label呗.
在left.aspx中的page_load中判断session是否存在。
你试试吧!应该可以!
this.btnAdd.Attributes.Add("onclick","javascript:window.parent.frames[0].location.href='left.aspx") ;