急!!!!!! ASP.NET模板页面跳转问题
RT:
问题描述:
问题是这样的,我有一个模板页面,而这个页面是由许多其他页面组成的,在这些组成页面中,我将判断Session是否为空,如果为空,将让整个页面跳转至登录页面,而我用的方法是 Response.Redirect("LOGIN.aspx"),这样的话,那些组成部分的页面就都变成了LOGIN.ASPX页面了。而我用后台代码注册JS的方法,调用parent.window.location.href,也没能解决问题
BASEPAGE.CS:
代码如下:在MAINPAGE模板页面中,那些子frameset都将继承自一个BASEPAGE.CS文件,这个文件将会判断Session,如果Session为空,就注册者段代码
String scriptString = "<script language=\"JavaScript\">";
scriptString += "function Page_Load(){ parent.window.location.href='./Login.aspx';}<";
scriptString += "/";
scriptString += "script>";
this.RegisterStartupScript("Startup", scriptString);
非常奇怪的是,以上这个方法也无法实现我要的效果,请高人帮忙,十万火急,最好能直接贴代码...... Orz
以下是MAINPAGE的代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs"
Inherits="SimulOrderWeb.WebPages.MainPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>一斉指令システム</title>
</head>
<frameset rows="65pt,500pt,20pt">
<frameset cols="250pt,*">
<frame src="LoginInfo.aspx" name="server" marginwidth="0pt" marginheight="0pt" noresize="noresize" scrolling="no" frameborder="0">
<frame src="Header.aspx" name="header" marginwidth="0pt" marginheight="0pt" noresize="noresize" scrolling="no" frameborder="0">
</frameset>
<frameset cols="150pt,*">
<frame src="Menu.aspx" name="menu" marginwidth="0pt" marginheight="0pt" noresize="noresize" scrolling="no" frameborder="0">
<frame src="ServerInfo.aspx" name="main" marginwidth="0pt" marginheight="0pt" noresize="noresize" scrolling="auto" frameborder="0">
</frameset>
<frame src="Footer.aspx" name="header" marginwidth="0pt" marginheight="0pt" noresize="noresize" scrolling="no" frameborder="0">
</frameset>
</html>