views:

1361

answers:

3
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.

+1  A: 

Maybe it is a regression issue from IE6?

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

Daniel Crenna
BPAndrew
A: 

what if you use server.urlencode?

that shows up but because it's not represented with the # character in the qstring it doesn't perform the function required
BPAndrew
+1  A: 

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]-->
scunliffe
document.location.hash = '<%= Request["hash"] %>'; that worked, thank you - changed to code above.if I server.transfer this - I can hide the url messyness - after all I'm just bouning back for ui updates, do you know if there are any implications to this?
BPAndrew