Anyone here using Response.Redirect()
method, do have you encountered some strange characters attached to the end of the uri on the browser address bar?
The strange characters are hash, underscore, equal sign and underscore (without spaces) such as below... I have no idea what are these all about and when these strange characters appear, the redirection didn't happen properly.
#_=_
Any insights on this please share. Thanks
Anything in the location-part
of a URL that follows a #
refers to an anchor in the page, usually an <a name="">
or <whatever id="">
. Some web sites use them (probably with client-side Javascript) to perform magic, but since you are asking this, I get the feeling that's not the case for you. So, there's no real rhyme or reason to that the existence or absence of those characters in and of themselves would cause the redirection to work or not. In fact, they aren't even sent to the server in the HTTP request (at least, Firefox doesn't).
Have you had a look at the HTTP request exchanges when this is happening? Something like Live HTTP Headers, HttpFox or Firebug (look at the Net panel) will help you with this, and might point you to where the errant #_=_
is coming from.
Here's my solution based on a couple others out there:
$(function () {
if (window.location.href.indexOf("#_=_") > -1) {
//remove facebook oAuth response bogus hash
if (window.history && window.history.pushState) {
history.pushState('', document.title, window.location.pathname);
} else {
window.location.href = window.location.href.replace(location.hash, "");
}
}
});
https://stackoverflow.com/a/7845639/1467810
https://stackoverflow.com/a/15323220/1467810
https://stackoverflow.com/a/2295951/1467810
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