Monday, October 06, 2008

Navigate the parent page from the IFrame page (child page)

When user clicks the link/button on a page inside the IFrame, it will bring up another page inside the IFrame and the parent page will not change.

Sometimes we do need the link/button on the Iframe page update the parent page. Here is how to do it.

If the link is used, make the target property "_top".
HyperLink

If the button is used, in the code-behind, do this:
Response.Write("<" + "script>" + "window.open('http://webpage_address','_top');<" + (char)47 + "script>");

No comments: