芜湖网站开发

芜湖网站开发公司

asp编辑当前记录,并返回当前页数

发布于:2016/11/10 阅读()次 标签:芜湖网络公司

1、首先编写这样三个函数

[code]'== 取得当前页面的URL地址

Function CurrentURL()

   Dim tmpstr, URL

   If Request.ServerVariables("HTTPS") = "ON" Then URL = "https://" Else URL = "http://"

   URL = URL & Request.ServerVariables("HTTP_HOST")

   tmpstr = Request.ServerVariables("SERVER_PORT")

   If tmpstr <> 80 Then URL = URL & ":" & tmpstr

               URL = URL & Request.ServerVariables("PATH_INFO")

   tmpstr = Trim(Request.ServerVariables("QUERY_STRING"))

   If tmpstr <> Empty Then URL = URL & "?" & tmpstr

   CurrentURL = URL

End Function

'== 将当前页面的URL地址写入Cookie变量

Sub WriteCurrentURL()

   Response.Cookies("URL") = CurrentURL

End Sub

'== 读取Cookie变量中的页面URL信息

Function ReadCurrentURL()

   ReadCurrentURL = Request.Cookies("URL")

End Function



2、然后在头一个页面一开始调用WriteCurrentURL过程,把当前页面的地址存入Cookie中去。在编辑页面编辑完成后用response.redirect ReadCurrentURL语句转回去。

这样不用传页码参数,而且如果列表页面是条件查询得来的,那传的参数就更多了,呵呵。这样做什么都不用管,参数都带着呢!




上一篇:asp 相对,绝对路径替换绝对路径

下一篇:asp获取内容当中第一张图片