HighTechTalks DotNet Forums  

How to get the requesting URL

ASP.net ASP.net discussions (microsoft.public.dotnet.framework.aspnet)


Discuss How to get the requesting URL in the ASP.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
magic kat
 
Posts: n/a

Default How to get the requesting URL - 07-26-2007 , 05:55 PM






How can I get the full url of the page that is calling my page? I tried the
below, but it gives me my page, not the page that redirected to me.
' Dim sURL as String

'if strcomp(Request.ServerVariables ("HTTPS"), "ON", 1) = 0 then

' sURL = "https://"

'else

' sURL = "http://"

'end if

' sURL = sURL & Request.ServerVariables ("SERVER_NAME")

' sURL = sURL & Request.ServerVariables ("SCRIPT_NAME")

' if len(trim(Request.QueryString.tostring)) > 0 then

' sURL = sURL & "?" & Request.QueryString.tostring

'end if

'Response.Write(sURL)

Thanks.



Reply With Quote
  #2  
Old   
Mark Rae [MVP]
 
Posts: n/a

Default Re: How to get the requesting URL - 07-26-2007 , 06:17 PM






"magic kat" <katmagicblue (AT) yahoo (DOT) com> wrote


Quote:
How can I get the full url of the page that is calling my page? I tried
the below, but it gives me my page, not the page that redirected to me.
Request.ServerVariables("HTTP_REFERER")

However, this can't be relied upon, as some browsers are able to spoof it,
and many ISPs strip it from the Request headers...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.