iframe 頁面按鈕點擊後,需在**頂層視窗**打開新頁面(跳出 iframe)。
<form action="target.aspx" target="_top" method="post">
<button type="submit">跳轉</button>
</form>
<a href="target.aspx" target="_top">跳轉</a>
// 按鈕 onclick
window.open('target.aspx', '_top'); // _top 表示頂層視窗
// 或
window.open('target.aspx', '_blank'); // 新分頁
Response.Redirect("target.aspx") 僅導致 **iframe 內部** 跳轉,無法跳出。必須配合客戶端腳本。