例如我从
a.aspx 页面中 打开b.aspx 
如何在b.aspx中知道他的上一个页面是a.aspx啊

解决方案 »

  1.   

    我试过,但是我每次都得到的是本页的url,不知道为什么
      

  2.   

    假设test为一虚拟目录则:
    Request.Path,Request.RawUrl
    获取的是形如/test/test.aspx的路径Request.Url.AbsoluteUri取得http://localhost/test/test.aspxRequest.ApplicationPath取得/testHttpContext.Current.Request.Url.Host 获得localhost
      

  3.   

    用 Request.ServerVariables("HTTP_Referer") 就可以了!
      

  4.   

    同意 sxBamboo(竹子) 
    Request.ServerVariables("HTTP_Referer") 
    不过这样获得的是整个的url
      

  5.   

    Request.ServerVariables["HTTP_Referer"].ToString();