IFRAME redirect page to Root ASP.NET

In my page I have an iframe.  When a certain thing happens in the code behind the iframe, the code below will execute

            HttpContext context = app.Context;


but this code executes from within the IFRAME.  I want the page that contains the IFRAME to change, not just within the IFRAME
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi cophi,

Try this code in the IFRAME:

string redirectCode = "<script>window.open('~/Page.aspx','_top');</script>";

It works perfectly on my website to redirect the user from an iframe.
cophiAuthor Commented:
I don't want to pop up a new window though, I want it to redirect the parent page.  I was also hoping to do this from the server side.  Somehow manipulating the request or response object.
My code will not open a new window, notice the target '_top'

It will be redirecting the user from the same browser window.
Ajay SharmaCommented:
put this on the button click event

Response.Write("<script>" & vbCrLf)
                        Dim strs As String
                        strs = "window.open('admin.aspx "','_parent');"
                        Response.Write(strs & vbCrLf)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.