How to get full URL including #...

  • Thread starter Thread starter Ben Amada
  • Start date Start date
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
 
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
 
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
 
Back
Top