要实现功能:default.aspx中当Sessions(“userid”)没有值时,跳转到一个新的页面login.asdpx。

如果在defalult页面里直接写Response.Redirect("login.aspx"),则login.aspx页面会在右边的frame中显示出来,而不是在整个页面中。所以要解决这个问题只能用下面这个方法:

Response.Write("<script>parent.location.href=login.aspx</script>");

下面是我的框架页面:

<frameset border=0 frameSpacing=0 frameBorder=no id ="frameset" cols="200,10,*" rows ="*" >
<frame src="left.aspx" name="leftFrame"   marginheight="0" marginwidth="0" scrolling="No" noresize="noresize" id="leftFrame" />
<frame src="mid.htm" name="midFrame"   marginheight="0" marginwidth="0" scrolling="No" noresize="noresize" id="midFrame" />
<frame src="default.aspx" name="mainFrame" id="mainFrame" marginheight="0" marginwidth="0" />
</frameset>