我请求这样的 URL:
http://mylocalsite/virtual/page.aspx?var1=1&var2=2&var3=3
我正在使用FormsAuthentication
并且未经身份验证,所以我被重定向了。这是浏览器位置栏显示的内容:
http://mylocalsite/virtual/login.aspx?ReturnUrl=/virtual/page.aspx?var1=1&var2=2&var3=3
在 login.aspx 的 PageLoad 事件中,我尝试以两种方式检查 URL:
Dim example1 as String = Request.Url
Dim example2 as String = Request.Url.Scheme & "://" & Request.Url.Authority & Request.RawUrl
这就是我得到的:
' Example 1
http://mylocalsite/virtual/login.aspx?ReturnUrl=/virtual/page.aspx?var1=1&var2=2&var3=3&var1=1&var2=2&var3=3
' Example 2 - is URLEncoded
http://mylocalsite/virtual/login.aspx?ReturnUrl=%2fvirtual%2fpage.aspx%3fvar1%3d1%26var2%3d2%26var3%3d3%26var1%3d1%26var2%3d2%26var3%3d3
为什么我的查询字符串在这两个示例中都加倍?