12

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);
}
sabadow
  • 5,095
  • 3
  • 34
  • 51
user3055923
  • 195
  • 2
  • 3
  • 9
  • 1
    possible duplicate of [How to get Url Hash (#) from server side](http://stackoverflow.com/questions/317760/how-to-get-url-hash-from-server-side) – Rune Vejen Petersen Apr 28 '15 at 11:26

2 Answers2

11

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

Community
  • 1
  • 1
Ratna
  • 2,289
  • 3
  • 26
  • 50
3

It's not possible to retrieve the #anchor from the server side in ASP.NET

This is a client-side flag to tell the browser to move to a specific place within the page.

Please take a look at this same discussion

Retrieving Anchor Link In URL for ASP.Net

and

Get full URL with hash to use as ReturnUrl

Community
  • 1
  • 1
Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234