response. # 앵커로 적용되며 IE7에서 작동하지 않습니다.
-
03-07-2019 - |
문제
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의 탭 컨트롤과 함께 이것을 사용하고 있다고 언급해야합니다. Postback이 특정 탭에 탭하기를 원합니다.
해결책
그것은 꽤 해킹 일 것이지만, 즉, 즉 행동하지 않으면, 당신은 이것을 할 수 있습니다.
예를 들어 매개 변수를 전달하십시오
uid=933fdf8e-1be0-4bc2-a269-ac0b01ba4755&result=saved&hash=main#main
그런 다음 페이지에서 (본체 닫기 태그 전 또는 온부하 이벤트), 즉, 현재 경우 매개 변수를 추출하고 해시를 수동으로 설정하십시오.
<!--[if IE]>
<script>
if(document.location.href.indexOf('&hash=') != -1){
//extract value from url...
document.location.hash = extractedValue;
}
</script>
<![endif]-->
다른 팁
IE6의 회귀 문제일까요?
시도해 보았 니 그 주변에서 일합니다 &와 함께 선물하여?
나는 사용했다 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);
제휴하지 않습니다 StackOverflow