469,360 Members | 1,774 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

Getting the full URL

I need to get the full URL of the current page in ASP. When using
Request.ServerVariables("URL") anything after the filename (such as a
#section1 to jump to an area on the page or data submitted from a form using
the GET method) is automatically removed. I do not know of any keys for the
Request.ServerVariables collection that do this, but cannot find any other
objects/properties that would be appropriate. Any help would be appreciated.
Thank You.
--
Nathan Sokalski
nj********@hotmail.com
www.nathansokalski.com
Jul 19 '05 #1
5 10490
Nathan Sokalski wrote on 28 jun 2004 in
microsoft.public.inetserver.asp.general:
I need to get the full URL of the current page in ASP. When using
Request.ServerVariables("URL") anything after the filename (such as a
#section1 to jump to an area on the page or data submitted from a form
using
the GET method) is automatically removed. I do not know of any keys
for the Request.ServerVariables collection that do this, but cannot
find any other objects/properties that would be appropriate. Any help
would be appreciated. Thank You.


response.write Request.ServerVariables("URL") & "?" & Request.querystring

Please stop this gross crossposting.

Foollow up only to: microsoft.public.inetserver.asp.general

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
>I need to get the full URL of the current page in ASP.

Then why are you posting to asp.net, webcontrols, webservices, and
components newsgroups?

Follow-ups set ONLY to asp.general.

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #3
That would work for data posted via a form using the GET method, but what
about URLs that jump to a specific part of the page (using something like
filename.asp#titleindex)?
--
Nathan Sokalski
nj********@hotmail.com
www.nathansokalski.com
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Nathan Sokalski wrote on 28 jun 2004 in
microsoft.public.inetserver.asp.general:
I need to get the full URL of the current page in ASP. When using
Request.ServerVariables("URL") anything after the filename (such as a
#section1 to jump to an area on the page or data submitted from a form
using
the GET method) is automatically removed. I do not know of any keys
for the Request.ServerVariables collection that do this, but cannot
find any other objects/properties that would be appropriate. Any help
would be appreciated. Thank You.


response.write Request.ServerVariables("URL") & "?" & Request.querystring

Please stop this gross crossposting.

Foollow up only to: microsoft.public.inetserver.asp.general

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #4
I think you are pretty much out of luck there. The browser doesn't appear to
send the page hash.

Here is what I get for a trace when I enter
http://localhost/wbtmanager/listsesvars.asp#help

GET /wbtmanager/listsesvars.asp HTTP/1.1
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: localhost
Connection: Keep-Alive
Cookie: ASPSESSIONIDAQDTTRCT=FALPMHFALOJJNKDGPKIEHFPO;
ASPSESSIONIDCSCSTQCS=NPLFPHFAOPELEGGFCEIKDJHE
--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
That would work for data posted via a form using the GET method, but what
about URLs that jump to a specific part of the page (using something like
filename.asp#titleindex)?
--
Nathan Sokalski
nj********@hotmail.com
www.nathansokalski.com
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Nathan Sokalski wrote on 28 jun 2004 in
microsoft.public.inetserver.asp.general:
I need to get the full URL of the current page in ASP. When using
Request.ServerVariables("URL") anything after the filename (such as a
#section1 to jump to an area on the page or data submitted from a form
using
the GET method) is automatically removed. I do not know of any keys
for the Request.ServerVariables collection that do this, but cannot
find any other objects/properties that would be appropriate. Any help
would be appreciated. Thank You.


response.write Request.ServerVariables("URL") & "?" & Request.querystring
Please stop this gross crossposting.

Foollow up only to: microsoft.public.inetserver.asp.general

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Jul 19 '05 #5
Right, this is all handled on the client side; the browser scans the HTML
and finds the <a name> bookmark, and scrolls to that location. ASP is never
involved in this process at all. In fact, in some scenarios, ASP can cause
the browser to bypass the process altogether.

http://www.aspfaq.com/2070

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:e$**************@TK2MSFTNGP09.phx.gbl...
I think you are pretty much out of luck there. The browser doesn't appear
to
send the page hash.

Here is what I get for a trace when I enter
http://localhost/wbtmanager/listsesvars.asp#help

GET /wbtmanager/listsesvars.asp HTTP/1.1
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: localhost
Connection: Keep-Alive
Cookie: ASPSESSIONIDAQDTTRCT=FALPMHFALOJJNKDGPKIEHFPO;
ASPSESSIONIDCSCSTQCS=NPLFPHFAOPELEGGFCEIKDJHE
--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
That would work for data posted via a form using the GET method, but what
about URLs that jump to a specific part of the page (using something like
filename.asp#titleindex)?
--
Nathan Sokalski
nj********@hotmail.com
www.nathansokalski.com
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
> Nathan Sokalski wrote on 28 jun 2004 in
> microsoft.public.inetserver.asp.general:
> > I need to get the full URL of the current page in ASP. When using
> > Request.ServerVariables("URL") anything after the filename (such as a
> >#section1 to jump to an area on the page or data submitted from a form
> >using
> > the GET method) is automatically removed. I do not know of any keys
> > for the Request.ServerVariables collection that do this, but cannot
> > find any other objects/properties that would be appropriate. Any help
> > would be appreciated. Thank You.
>
> response.write Request.ServerVariables("URL") & "?" & Request.querystring >
> Please stop this gross crossposting.
>
> Foollow up only to: microsoft.public.inetserver.asp.general
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)



Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Elie B. | last post: by
1 post views Thread by sumGirl | last post: by
4 posts views Thread by ItsMe | last post: by
reply views Thread by Patrick Olurotimi Ige | last post: by
2 posts views Thread by bil.shah | last post: by
4 posts views Thread by BLIZZARDICE | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.