Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the full url of the current page with url hash on server side

Tags:

c#

url

asp.net

I cant get the full url of the page that I am working on. This is the url that I want to get http://localhost:54570/Shipment/ShipmentDetails.aspx?HawbBLNo=NEC00000004#BFTThe result is only http://local/Shipment/ShipmentDetails.aspx?HawbBLNo=NEC00000004 on this code

protected void btnSave_Click(object sender, EventArgs e)
{
    url = HttpContext.Current.Request.Url.AbsoluteUri;
    UpdateDetails();
    Response.Redirect(url);
}
like image 322
user3055923 Avatar asked Jan 03 '14 10:01

user3055923


People also ask

How do I find the URL of a hash?

The hash of a url can be found by creating a new URL Javascript object from the URL string, and then using its hash property to get the value of the hash fragment. Note that this will include the # character also. If the url does not contains a hash, then an empty string "" will be returned.

How do I use a hash symbol in a URL?

In a URL, a hash mark, number sign, or pound sign ( # ) points a browser to a specific spot in a page or website. It is used to separate the URI of an object from a fragment identifier. When you use a URL with a # , it doesn't always go to the correct part of the page or website.

Which part of the URL is hash?

The fragment identifier introduced by a hash mark # is the optional last part of a URL for a document. It is typically used to identify a portion of that document.

Can you have multiple hashes in URL?

To sum up: Only one "#" is allowed in a compliant URL (or URI) as the marker for the URL-fragment. Especially hash signes that are supposed to be in the path (at least from the looks, as there are slashes afterwards) are problematic as they officially terminate the path part.


1 Answers

there is no way to get hash content on server side because hash are never posted to the server

see this question for some tricks How to get Url Hash (#) from server side

like image 66
Ratna Avatar answered Sep 27 '22 22:09

Ratna