I get one page inside frame which intends to redirect users to another web site. However, only the the page inside the frame get changed to another web site.
What kind of measure can I use to redirect whole doucment to another web site?
Thank you!
I get one page inside frame which intends to redirect users to another web site. However, only the the page inside the frame get changed to another web site.
What kind of measure can I use to redirect whole doucment to another web site?
Thank you!
When your page is inside an iframe, the Response.Redirect
is only redirect the same page, that is in the iframe, not the parent one - one workaround is to register a javascript call, that can "say" to the parent window to redirect.
For example, you can do that:
ClientScript.RegisterStartupScript(this.GetType(), "scriptid",
"window.parent.location.href='redirectpage.aspx'", true);
at code behind to redirect the parent window to a new location.
The same way you can call this script from any javascript code to say to the top window to redirect.
top.location.href = "redirect.aspx" ;
reference: asp.net forum,
How to prevent IFRAME from redirecting top-level window
in Asp.net just use:
Response.Redirect("webpagename.aspx");