public partial class loginok : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Session["teauser"].ToString();
Label2.Text = Session["pos"].ToString();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
if (Label2.Text.ToString().Equals("管理员"))
{
Response.Redirect("admin.aspx"); }
if (Label2.Text.ToString().Equals("教师"))
{
Response.Redirect("stuloginok.aspx"); }
}
}不知道为什么页面跳转不了
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Session["teauser"].ToString();
Label2.Text = Session["pos"].ToString();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
if (Label2.Text.ToString().Equals("管理员"))
{
Response.Redirect("admin.aspx"); }
if (Label2.Text.ToString().Equals("教师"))
{
Response.Redirect("stuloginok.aspx"); }
}
}不知道为什么页面跳转不了
Label2.Text = Session["pos"].ToString();
}
if("管理员".Equals(Label2.Text))
public partial class loginok : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
Label1.Text = Session["teauser"].ToString();
Label2.Text = Session["pos"].ToString();
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
if (Session["pos"].ToString().Trim().Equals("管理员"))
{
Response.Redirect("admin.aspx");
}
if (Session["pos"].ToString().Trim().Equals("教师"))
{
Response.Redirect("stuloginok.aspx");
}
}
}
设置断点,Watch下Session中的内容,很容易解决的。
虚拟 目录 造成