3

Possible Duplicate:
How to get Url Hash (#) from server side
c# get complete URL with “#”

If I call the page http://www.mywebsite.it?param=1 with

Request.Url 

I get it all. But on http://www.mywebsite.it?param=1#1234

I can't get the whole address. #1234 is ignored. How can I get it?

Community
  • 1
  • 1
markzzz
  • 47,390
  • 120
  • 299
  • 507

4 Answers4

2

You can't get the portion that starts with a # since this isn't normally transmitted to the server.

It is only handled client side.

As such, you may be able to use javascript to extract it and transmit to the server (XHR, hidden field or any other technique).

Oded
  • 489,969
  • 99
  • 883
  • 1,009
0

This is not possible as far as I know. See the following SO question:

How to get Url Hash (#) from server side

The answer there might provide you with a nice little workaround, however, including the hash-values when you do a POST.

Community
  • 1
  • 1
Anders Arpi
  • 8,277
  • 3
  • 33
  • 49
0

Anchors are a client-side feature. The anchor component of a URL is not (and should not be) transmitted to the server.

dtb
  • 213,145
  • 36
  • 401
  • 431
0

Please read this for clarification: https://www.rfc-editor.org/rfc/rfc1738

"The character '#' is unsafe and should always be encoded because it is used in World Wide Web and in other systems to delimit a URL from a fragment/anchor identifier that might follow it."

Community
  • 1
  • 1
Paul Bullivant
  • 668
  • 7
  • 13