i am receiving GET requests like this
http://localhost/controller/List#SearchGuid=755d259d-e7c9-4c5a-bf2a-69f65f63df8d
and i need to read the SearchGuid which is after the #. unfortunately the HttpRequestBase seems the hide everything past a #.
does somebody know how i could still read the SearchGuid from within the controller action?
tia.
A fragment is an internal page reference, sometimes called a named anchor. It usually appears at the end of a URL and begins with a hash (#) character followed by an identifier. It refers to a section within a web page.
Anything after the forward-slash is a “subdirectory.” Think of how you have a “Documents” folder, and you can have other folders under that. If domain.com refers to your top-level folder, domain.com/myproject refers to the “myproject” folder within it.
window. location. pathname. split('/'); is a more elegant solution in most cases if you are trying to access the different sections of the URL beyod the standard protocol and www etc.
You can't, it doesn't get sent to the server.
If you want to process url "fragments" (that's what those things after the '#' are called), you'll need to do so client side. Fragments are not transmitted to the server.
Either redesign the protocol to use a query string (replace '#' by '?'), or use javascript on the client to do the necessary processing - which may include making a server request that encodes the fragment in a URI query string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With