为防止机房故障时用户无法浏览网页,我在一个页面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?请给出具体代码(我基础很差,最好写全)。
谢谢!
<%
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?请给出具体代码(我基础很差,最好写全)。
谢谢!
你这个iframe里的src直接请求到后台 重新到数据库查一遍然后返回到1.asp页面
一般提交新信息到数据库后 都是重新查一遍然后返回页面展示更新后的数据
//XYHT-15
Response.Expires = -1;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
Response.CacheControl = "no-cache";
Response.Buffer = false;
%>
我试过了,可以
这段代码写在1.asp里?还是2.asp里?
这是在页面2.asp里用<iframe src="1.asp?uid=<%=Rs("UserID")%>" id="re2" name="re2"></iframe>调用用户页面1.asp的情况吗?