0

我有一个网络应用程序,当单击链接时会打开一个新窗口。不过,只要我这样做,我的浏览器缓存就会被清除。如果我不点击链接,缓存仍然存在。

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

这是对遇到相同问题但没有解决方案的其他人的参考。

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

知道为什么吗?

IE 7 和 8

4

1 回答 1

0

这对我有用,请尝试并告诉我:

Html 第 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>

代码隐藏页面 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 第 2 页(弹出):

<%@ 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>
于 2012-04-26T00:49:29.157 回答