asp的框架刷新问题

来源:百度知道 编辑:UC知道 时间:2024/05/11 23:52:07
我在html中建立了两个iframe框架 一个做留言本的表单 另一个显示留言数目
怎么样才能 当提交完表单后 在主页面中刷新另一个框架 让它显示出最新的留言信息
那条语句在什么页面下添加呢 框架页面
还是 表单页面

还是不行啊
用的是<iframe>定义的框架
<iframe src="liuyan.asp" name="liuyan"></iframe>
<iframe src="liuyanben.asp" name="liuyanben"></iframe>

我照着你说的那样改了 可是还不没能达到效果啊
提交留言后 列表页面 把表单页面替换了 而没在主页面中刷新 列表框架

注意这段代码:
response.write"<script>alert('操作成功!);parent.left.location.reload();self.location.href=guestbook.asp';</script>"
其中left可以改写成你显示留言数目的那个框架名就可以。这是我自己网站使用的代码,完全可以实现你所需的功能(因个人情况不同,或许要做些修改或调试)。如果想要功能更好就使用AJAX吧。呵。。

OK,我刚测试了一上,只需要小改一下,代码如下:
if Sp ="lg" then
title = Request("title")
authr = Request("authr")
content = Request("content")
sql = "insert into guestbook(title,authr,content) values('"&title&"','"&authr&"','"&content&"')"
set ors = conn.execute(sql)
Response.Write("<script>alert('留言成功!');parent.liuyanben.location='liuyanben.asp';self.location='liuyan.asp'</script>")
'ors.close:Set ors = nothing
end if
注意:起作用的是parent.liuyanben.location='liuyanben.asp';
祝你成功!!
你的两个<iframe>框架要命名或给个ID值,我测试时