页面test.aspx中有一框架:
<frameset id="frame" framespacing="0" border="false" cols="180,*" frameborder="1" scrolling="yes">
<frame name="left" scrolling="auto" marginwidth="0" marginheight="0" src="Left.aspx">
<frameset framespacing="0" border="false" rows="15,*" frameborder="0" scrolling="yes">
<frame name="top" scrolling="no" src="">
<frame name="main" scrolling="auto" src="main.aspx">
</frameset>想实现如下功能:
如果某一session值为空,那么此test.aspx直接转向index.aspx页面.
在page_load()函数中使用下面的语句无反应:
if(Session["abc"].ToString()==null)
{
Response.Redirect("index.aspx");
}请教实现方法!
<frameset id="frame" framespacing="0" border="false" cols="180,*" frameborder="1" scrolling="yes">
<frame name="left" scrolling="auto" marginwidth="0" marginheight="0" src="Left.aspx">
<frameset framespacing="0" border="false" rows="15,*" frameborder="0" scrolling="yes">
<frame name="top" scrolling="no" src="">
<frame name="main" scrolling="auto" src="main.aspx">
</frameset>想实现如下功能:
如果某一session值为空,那么此test.aspx直接转向index.aspx页面.
在page_load()函数中使用下面的语句无反应:
if(Session["abc"].ToString()==null)
{
Response.Redirect("index.aspx");
}请教实现方法!
Response.End();
{
Response.Redirect("index.aspx");
}
{ Response.Write("<script>window.parent.parent.location.href='index.aspx';</script>");
Response.End();
}
{
Response.Redirect("index.aspx");
}
这样写不对,如果Session["abc"]真的为空的话它就没法用ToTtring()
建议这样
Session["abc"] == null
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Admin_Name"] == null)
{
Response.Redirect("index.aspx"); }
}
依然没有反应!