How to get full URL including #...

B

Ben Amada

Hi. I'm trying to get the full URL of a page including # and what follows
it. An example URL would be:

http://www.mysite.com/page.aspx#contacts

I've tried:
Request.Url.AbsoluteUri
Request.ServerVariables("URL")
Request.RawUrl

But none of the above methods returns the "#contacts" portion of the URL.

Is it possible to get this last part of the URL?

Thank you,
Ben
 
H

Hans Kesting

Ben said:
Hi. I'm trying to get the full URL of a page including # and what
follows it. An example URL would be:

http://www.mysite.com/page.aspx#contacts

I've tried:
Request.Url.AbsoluteUri
Request.ServerVariables("URL")
Request.RawUrl

But none of the above methods returns the "#contacts" portion of the
URL.
Is it possible to get this last part of the URL?

Thank you,
Ben

It is possible that the browser omits that part when it sends a request
to the server. I've had some problems sending a URL with "#" to the
server: the # ended up as part of a parameter-value.

It *should* have only client-side functionality.

Hans Kesting
 
B

Ben Amada

Hans said:
It is possible that the browser omits that part when it sends a request
to the server. I've had some problems sending a URL with "#" to the
server: the # ended up as part of a parameter-value.

It *should* have only client-side functionality.

Hans Kesting

Hi Hans,

That's too bad I can't retrieve the # portion of the URL on the server-side.
For my purposes, I think I can workaround this by using a query string
variable.

Thanks very much!
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top