asp如何返回上一页并且刷新

1、返回上一页并刷新

方法一:

Response.Write("<SCRIPT language=JavaScript>alert(‘提示:操作成功!‘);this.location.href=‘"&request.ServerVariables("HTTP_REFERER")&"‘;</SCRIPT>")

其中 request.ServerVariables("HTTP_REFERER") 为上一页地址(来源地址)

方法二:response.redirect(request.ServerVariables("HTTP_REFERER")) 直接返回不提示,也可在返回前提示,


response.write "ok"
response.redirect(request.ServerVariables("HTTP_REFERER"))

方法三:

在Asp页面首部加入
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"

禁止缓存,那么返回后数据会重新读取。也可以起到刷新作用。

2、返回上一页不刷新

<Script language=JavaScript>alert(‘对不起,您输入的用户名已经存在!‘);;history.back();</Script> 或 <Script language=JavaScript>alert(‘对不起,您输入的用户名已经存在!‘);;history.gok-1();</Script>

http://www.4shared.com/game/nGZk6P2yba/2014-03-30.html
http://www.4shared.com/game/2qZ3i1rmba/2014-03-30.html
http://www.4shared.com/game/63yOs-9Eba/2014-03-30.html



http://www.4shared.com/game/kLpIxpjWba/2014-03-31.html
http://www.4shared.com/game/w4Z_UYWLce/2014-03-31.html
http://www.4shared.com/game/9FzPncRDce/2014-03-31.html
http://www.4shared.com/game/9aGFqMyEba/2014-03-31.html
http://www.4shared.com/game/t8FDLbOtba/2014-03-31.html
http://www.4shared.com/game/0MGwBqgbba/2014-03-31.html
http://www.4shared.com/game/ibSTcc8Aba/2014-03-31.html
http://www.4shared.com/game/BoyjNVc0ba/2014-03-31.html
http://www.4shared.com/game/Iw2mNNd0ba/2014-03-31.html

asp如何返回上一页并且刷新,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。