Forum Moderators: open

Message Too Old, No Replies

ASP - Getting the Relative Link

How can I get the relative link in ASP?

         

swinslow15

9:06 pm on Jan 17, 2002 (gmt 0)



Lets say I have a link ThePage.asp#Here.

When Someoone goes there, I can get the URL using request.servervariables("URL"). I will then retrieve ThePage.asp..

I would also like to capture #Here. (the realtive link).

Any suggestions?

ralnikov

12:03 pm on Jan 18, 2002 (gmt 0)

10+ Year Member



it seems to be impossible - no result in Request.ServerVariables when requesting page with #xyz

Xoc

4:43 pm on Jan 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I didn't see any way either. It doesn't show up in any of the server variables, and I didn't see any other property that would give it.

swinslow15

7:14 pm on Jan 18, 2002 (gmt 0)



Maybe MS will figure something out in the next version ...

bassrek

7:52 pm on Jan 18, 2002 (gmt 0)



I don't know of an ASP function or anything to get it, but JavaScript has a window.location.hash property that will grab it.

If that doesn't work, you can do an InStr function on the querystring in ASP to find the location of the '#' character and get it that way.

Hope that helps,
Mike

ralnikov

2:30 pm on Jan 19, 2002 (gmt 0)

10+ Year Member



I do not that there are a workaround for that situation. I'm too lazy to test but i think browser do not pass #xyz request part to server at all. it just repositions the content after grabbing it from server. So script cannot determine relative position in any way.