zoukankan      html  css  js  c++  java
  • ASP中得到当前页面完整URL的方法[转帖]

    可以这样构造当前页面完成的URL:
    "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING")

    取得了这个字符串后,我们在写有关“主/明细表”程序的时候,当在明细表页面经过了多次操作后,最后仍然可以回到主表中,查询参数和页码都保留了。当然如果明细表操作在新开窗口中进行,那就不用我在这儿叽里咕噜了。

    具体怎么实现呢?例如我们有学生列表,通过班级或者年龄等条件查询出来,并且翻到了中间页码。我们可以在页面顶端加上:
    Response.Cookies("MySite")("URL")="http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING")

    把当前页面的URL写入Cookies中,在点击姓名到明细表,并且经过了编辑更新或者删除等等操作后,通过语句:
    Response.Redirect(Request.Cookies("MySite")("URL"))

    转自: http://www.web-v.com/blog/blogview.asp?logID=22
  • 相关阅读:
    Apache 虚拟主机 VirtualHost 配置
    ajax无线级刷新
    Apache中 RewriteRule 规则参数介绍
    用户注册
    用户登录
    Android 侧滑菜单
    PhontoShop CS6 视频
    ArcGis地图
    Android 汉子转换成拼音
    UTF-8 转 GBK
  • 原文地址:https://www.cnblogs.com/Dicky/p/122536.html
Copyright © 2011-2022 走看看