为防止机房故障时用户无法浏览网页,我在一个页面1.asp加了10天缓存:
<%
Response.Buffer = True
Response.CacheControl="Public"
Response.ExpiresAbsolute = Date()+10
%>
但平时用户在页面2.asp提交新信息到数据库后,用户页面1.asp无法自动刷新,页面中还是旧数据。我在页面2.asp里用<iframe src="1.asp?uid=<%=Rs("UserID")%>" id="re2" name="re2"></iframe>调用用户页面1.asp后,尝试location.reload()和Response.Redirect都不能刷新:
parent.re2.window.location.reload();
parent.re2.Response.Redirect.src='1.asp?uid=<%=UserID%>';请问怎样刷新iframe中的1.asp?请给出具体代码(我基础很差,最好写全)。
谢谢!

解决方案 »

  1.   

    parent.re2.Response.Redirect.src='1.asp?uid=<%=UserID%>&stamp=xxxxx';xxxx用随机数或者当前时间试试?
      

  2.   

    parent.re2.window.location.reload(true);
      

  3.   

    因为在1.asp页面中加入了10天缓存,我要刷新的只是某个用户页面1.asp?uid=<%=UserID%>。加入多余参数后,刷新的是含有多余参数的页面,真正用户要看的页面1.asp?uid=<%=UserID%>并没有刷新。
      

  4.   


    你这个iframe里的src直接请求到后台 重新到数据库查一遍然后返回到1.asp页面
      一般提交新信息到数据库后 都是重新查一遍然后返回页面展示更新后的数据
      

  5.   

    <%
            //XYHT-15
            Response.Expires = -1;
            Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
            Response.CacheControl = "no-cache";
            Response.Buffer = false;
            %>
    我试过了,可以
      

  6.   

    看不明白你的代码,我基础很差。
    这段代码写在1.asp里?还是2.asp里?
    这是在页面2.asp里用<iframe src="1.asp?uid=<%=Rs("UserID")%>" id="re2" name="re2"></iframe>调用用户页面1.asp的情况吗?
      

  7.   

    2.asp提交到数据库了。但是1.asp的东西还是原先的缓存,并未因为2.asp更新了数据,而自己去重读数据库,把数据缓存下来。