ASP网站后台程序问题

来源:百度知道 编辑:UC知道 时间:2024/09/27 12:10:20
if newsname="" then
response.Write("<script language='javascript'>alert('添加成功');window.document.location.href='javascript:history.back(-1)'</script>")
response.end
end if
我做了一个新闻发布系统.但是我添加新闻添加成功的时候这样写的,当添加完一个新闻的时候,他跳转到前面那个添加页面(继续添加),但是跳过来后页面还保留我开始写的信息,怎么改让他跳转过来的时候.是我最处的添加新闻的页面,就是这个页面还没填任何东西的状态.
问题补充:
我用的框架结构.上页头,左导航,右边操作页.我写成具体的连接的话,返回过后.右面操作页就是空白(左边没选择操作的时候),我想返回过后,是我左边选择了添加新闻过后的那个状态.
没response.redirect这个方法噢

我做时没有使用“history.back”

而是用 response.redirect 方法转到添加新闻的页面。

你可以去掉“window.document.location.href='javascript:history.back(-1)”

直接用 response.redirect 跳转回去就行了。

PS:有response.redirect 方法的。

如:response.redirect "Sch_New_List.asp"

就是跳转到Sch_New_List.asp 页面,即:通过对象response的redirect方法 转到Sch_New_List.asp页面。

if newsname="" then
response.Write("<script language='javascript'>alert('添加成功')</script>")
response.redirect "新闻添加页面"
response.end
end if

sam_yy_cn 说的方法也行吧,我没有试过。

if newsname="" then
response.Write("<script language='javascript'>alert('添加成功');window.document.location.href='abc.html'</script>")
response.end
end if

把上面的 abc.html 改成你添加新闻的页面地址,就可以了。不要用 history.back(-1) 这个相当于按浏览器的后退键