框架刷新问题,应该不难,但查遍了历史贴的相关内容还是没解决,高手请帮忙!!!

yweihua 2003-11-19 05:39:34
以下是主框架代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>*******管理系统</title>
</head>
<%
busyusername=request.cookies("busyusername")
guanlidanwei=request.cookies("guanlidanwei")
realname=request.cookies("realname")
%>
<frameset rows="62,*" cols="*" framespacing="0" border="0">
<frame src="top.asp" name="top" scrolling="NO" noresize >
<frame src="index.asp" name="contents">
</frameset>
<noframes><body>

</body></noframes>
</html>
我在index.asp的窗口(即contents)先打开了login.asp,然后在login.asp页面如果输入正确的用户名和密码就可以登录进managesystem.asp页面(该页面也在contents显示),但我想在登录进managesystem.asp的同时,top.asp刷新一下,因为top.asp里是问候语,当你未登录时,它显示:您好,欢迎使用管理系统!,当你登录进managesystem.asp后,它立即刷新并显示为:张三丰您好,今天是*年*月*日,这是您第5次登录,现在就是这个刷新我实现不了,请教各位!!!
以前的贴子多是用:
parent.top.location.reload();
parent.frames['top'].location.reload();
等,都试过了,一点反应都没有!!!
下面是login.asp部分代码:
<%if request("submit")="登录" and 用户名密码都正确 then
response.redirect "managesystem.asp"
%>
<script>
parent.top.location.reload();
</script>
<%else%>
你的输入出错了!
<%end if%>

能搞定必给高分!
...全文
52 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
yweihua 2003-11-20
  • 打赏
  • 举报
回复
哦,可以了,谢谢大家,
原来我在测试的过程中加了一行多余的代码,删除后就可以了。
各位准备接分吧!
有更好的办法请加在后面!
yweihua 2003-11-20
  • 打赏
  • 举报
回复
已经改过了,各部分代码如下:
main.asp的代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>*********管理系统</title>
</head>
<%
busyusername=request.cookies("busyusername")
guanlidanwei=request.cookies("guanlidanwei")
realname=request.cookies("realname")
%>
<frameset rows="62,*" cols="*" framespacing="0" border="0">
<frame src="top.asp" name="topframe" scrolling="NO" noresize >
<frame src="index.asp" name="contents">
</frameset>
<noframes><body>

</body></noframes>
</html>

top.asp的代码如下:
<!--#include file="asp/webhead.asp"-->
<html>
<head>
<base target = "top">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="css/css.css">
<script language="javascript1.2" src="js/time.js"></script>
<script language="javascript1.2" src="js/openwin.js"></script>
<title>*******管理系统</title>
</head>
<body bgcolor="#eeeeee" topmargin="0" leftmargin="5" onLoad="go()">
<%
call webhead()
%>
</body>
</html>

login.asp的部分代码:
<%
if request("submit")="提交" and 用户名密码正确 then
%>
<script>
parent.frames["topframe"].location.reload();
window.location.replace("jssjdt.asp");
</script>
<%
else
%>
其它内容
<%
end if
%>
DeltaCat 2003-11-20
  • 打赏
  • 举报
回复
你把框架的名字改成其他,不要叫 “top”,这个词有其他意思
yweihua 2003-11-20
  • 打赏
  • 举报
回复
高手们快来看看啊,拜托了
yweihua 2003-11-19
  • 打赏
  • 举报
回复
我加了,但top.asp还是在整个窗口打开,而框架没有了,managesystem.asp就更没有了。
DeltaCat 2003-11-19
  • 打赏
  • 举报
回复
你的方法错,是因为你的顺序写反了

在你的 top.asp 里加一句,
<base target = "top">

放在 <head></head>之间
yweihua 2003-11-19
  • 打赏
  • 举报
回复
to fason(阿信):
非常感谢,我试着把name=top改成了name=topframe,然后把您的那两行代码加进去,但是登录后发现框架不见了,它把top.asp在整个窗口打开了!
这是什么问题啊?
fason 2003-11-19
  • 打赏
  • 举报
回复
<%if request("submit")="登录" and 用户名密码都正确 then
'session
%>
<script>
parent.frames["top"].location.reload();//you'd better use other name,not "top"
window.location.replace("managesystem.asp");
</script>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧