Question

Response.Redirect(string.Format("myprofile.aspx?uid={0}&result=saved#main",user.UserID));

said code translates to

IE7 - myprofile.aspx?uid=933fdf8e-1be0-4bc2-a269-ac0b01ba4755&result=saved

FF- myprofile.aspx?uid=933fdf8e-1be0-4bc2-a269-ac0b01ba4755&result=saved#main

why does IE7 drop my anchor?

edit: I should mention I am using this in conjunction with jQuery UI's tab control. I want the postback to tab into a specific tab.

Was it helpful?

Solution

It would be quite the hack, but if IE isn't behaving, you could do this.

pass a param as well, e.g.

uid=933fdf8e-1be0-4bc2-a269-ac0b01ba4755&result=saved&hash=main#main

Then on your page (before the body close tag, or as an onload event), only for IE, extract the parameter if present and set the hash manually.

<!--[if IE]>
<script>
  if(document.location.href.indexOf('&hash=') != -1){
    //extract value from url...
    document.location.hash = extractedValue;
  }
</script>
<![endif]-->

OTHER TIPS

Maybe it is a regression issue from IE6?

Did you try working around it by prepending it with an &?

I used RegisterClientScriptBlock to issue window.location.

Something like this:

string url = String.Format("{0}RegForm.aspx?regId={1}#A", this.CurrentFolderUrl, this.RegId);

Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "redirectToClientPage", String.Format("window.location='{0}'", url), true);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top