2
我請求的URL是這樣的:Request.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的事件中,我試圖從網址兩種方式:
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
爲什麼我的查詢字符串在這兩個例子中翻倍?
本地主機(Windows 7 SP1)或活動站點(Windows Server 2008 R2 SP1)和應用程序池= .NET v4.0上的IIS = 7.5.7600.16385集成管道 – wweicker