Anchors or URL fragments, as mentioned in RFC 1738 , are not sent by the client to the server when the resource is requested. The rationale is that the fragment URLs are used to determine the location in the resource, and not for another resource on the server. To determine the location in the resource, the client needs to get the full resource from the server, and this process does not require the transfer of information about the fragment (since this does not mean anything to the server).
If you want to send information through a query string using a URL containing a fragment, you need to make sure that the sequence of requests precedes the fragment of the URL. This may be a mistake in your client code if you create the request yourself. Leave the logic for building the request in the browser if you can afford it.
If you want to send a fragment symbol (#) to the server, you will need to encode it in the query string, otherwise the client (browser) will simply ignore this section of the URL when it sends a request to the server.
Questions Related to SO
source share