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

I cannot get the full URL of the page I'm working on. This is the url I want to get http://localhost:54570/Shipment/ShipmentDetails.aspx?HawbBLNo=NEC00000004#BFT . The result is only http://local/Shipment/ShipmentDetails.aspx?HawbBLNo=NEC00000004 in this code

 protected void btnSave_Click(object sender, EventArgs e) { url = HttpContext.Current.Request.Url.AbsoluteUri; UpdateDetails(); Response.Redirect(url); } 
+8
c # url
source share
2 answers

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

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

+8
source share

Unable to get #anchor from server side in ASP.NET

This is a client-side flag to tell the browser to go to a specific location on the page.

Please take a look at the same discussion.

Retrieving URL Binding for ASP.Net

and

Get the full hash URL to use as ReturnUrl

+3
source share

All Articles