나는 이것이 가능하지 않지만 iFrame에서 Response.Redirect
을 수행하여 부모 페이지를 리디렉션하려는 가장 좋은 방법은 무엇입니까?Response.Redirect() in iFrame, 리디렉션 상위 창
6
A
답변
11
ASP.NET을 사용하여이 작업을 수행 할 수 없습니다. 서버 쪽의 ASP.NET은 들어오는 요청을 리디렉션 할 수 있으며 부모 프레임에 대해 알 수 없습니다.
하지만이 같은 서버에서 자바 스크립트를 호출 할 수있는 서버 측 상태에서 상위 프레임을 재 지정하려는 경우 :
protected void Page_Load(object sender, EventArgs e) {
ClientScriptManager.RegisterClientScriptBlock(this.GetType(),
"RedirectScript", "window.parent.location = 'http://yoursite.com'", true);
}
물론 당신이 간단한 자바 스크립트 window.parent.location을 사용할 수 있습니다 = 'HTTP : //yoursite.com '클라이언트쪽에 있습니다.
1
Response.Clear();
Header.Controls.Add(new LiteralControl(@"
<script type=""text/javascript"">
top.location = ""/Logout.aspx"";
parent.location = ""/Logout.aspx"";
</script>
"));
5
방금 다음 코드를 성공으로 사용했습니다. 그것도 X-Frame-Options SAMEORIGIN
을 무시하고 iframe에 다른 한 도메인에서 리디렉션을 허용합니다
string url = "https://siteurl.com";
Response.Write("<script>top.location='"+url+"';parent.location='"+url+"';</script>");
관련 문제
- 1. Response.Redirect in HttpModule
- 2. Response.Redirect()의 IFrame 문제
- 3. iframe 리디렉션
- 4. Mac Google Chrome iframe 액세스 상위 창
- 5. Iframe 상위 URL
- 6. 상위 iframe
- 7. iframe designMode in firefox
- 8. iframe in HTML
- 9. Iframe 페이톤 리디렉션 부모
- 10. iframe 크롤링 및 리디렉션
- 11. .htaccess 리디렉션 iframe 제외
- 12. WPF 상위 창 바인딩
- 13. iframe 호출 상위 자바 스크립트
- 14. Response.Redirect
- 15. javascript 상위 및 하위 창
- 16. URL 리디렉션 in ASP.NET
- 17. 모달 창 리디렉션
- 18. iframe에서 Javascript 상위 페이지 리디렉션
- 19. Facebook 로그인 및 Iframe 리디렉션
- 20. Facebook iframe 신청서 양식 리디렉션
- 21. Opera에서 상위 창 프로토콜 테스트
- 22. 하위 (iframe)에서 상위 페이지로의 세션 유지
- 23. Response.Redirect with jQuery Thickbox 사용
- 24. Response.Redirect()가 작동하지 않습니다.
- 25. asp.net : response.redirect - threadabortedexception 처리
- 26. asp.net에서 Response.Redirect()를 작성하는 방법
- 27. iframe div 내용을 상위 페이지에 표시
- 28. jQuery iframe 팝업 및 상위 양식 게시
- 29. 도메인 간 iframe 문제 (상위 위치 설정)
- 30. 로컬로 iframe 상위 위치 문제가 개최
주 프레임 부모 프레임 문서의 도메인이 오류는 대부분의 브라우저에서 발생되는 액세스 거부를 피하기 위해 일치해야 함 . – Chris
부모님이 프레임에 다른 도메인이 있다면? – Kiquenet