从IE中的父窗口打开一个新窗口将清除父窗口的缓存

时间:2012-04-25 19:20:25

标签: asp.net internet-explorer browser-cache

我有一个网页应用,可以在点击链接时打开一个新窗口。但是,只要我这样做,我的浏览器缓存就会被清除。如果我没有单击该链接,缓存仍然存在。

我尝试了标准的target="_blank"window.open方法,它们都会导致清除缓存。

以下是对遇到相同问题的其他人的引用,但没有解决方案。

http://www.pcreview.co.uk/forums/problem-new-window-clears-cache-t693284.html

知道为什么?

IE 7和8

1 个答案:

答案 0 :(得分:0)

这对我有用,试试让我知道:

Html Page 1(家长):

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="wpop1.aspx.vb" Inherits="pruebas_wpop1" %>

<!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 runat="server">
    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PRIVATE" />
    <title>Parent</title>  
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:TextBox runat="server"></asp:TextBox>
    <a href="wpop3.aspx" target="_blank" >Popup</a><br/>
    <asp:Button runat="server" Text="Button" />
    </div>
    </form>
</body>
</html>

Codebehind Page 1:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load       

        Response.ExpiresAbsolute = DateTime.Now.AddDays(2D)
        Response.Expires = 7200
        Response.CacheControl = "PRIVATE"

End Sub

Html Page 2(PopUp):

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="wpop3.aspx.vb" Inherits="pruebas_wpop3" %>

<!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 runat="server">       
    <title>PopUp</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    This is the Popup Window.
    </div>
    </form>
</body>
</html>