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

所述代码转换为

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

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

为什么IE7会掉落我的锚?

编辑:我应该提到我将它与jQuery UI的选项卡控件结合使用。我希望将回发标签导入特定标签。

有帮助吗?

解决方案

这将是非常糟糕的,但如果IE没有表现,你可以这样做。

也传递一个参数,例如

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

然后在您的页面上(在正文关闭标记之前,或作为onload事件),仅针对IE,提取参数(如果存在)并手动设置哈希值。

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

其他提示

也许这是IE6的回归问题?

您是否尝试过解决此问题在前面添加&amp;?

我使用 RegisterClientScriptBlock 发出 window.location

这样的事情:

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);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top