views:

3548

answers:

4

A client has an asp page with an iframe. The Iframe loads an asp.net page inside the asp classic page.

The ASP.NET page is responsible for connecting to a webservice, displaying some data, and then when the user clicks a button it does a response.redirect another classic asp page.

Since the asp.net page is in an iframe, the asp page loads inside the iframe when ideally it should be taking over the entire page.

I have tried putting javascript in the final asp page to break out of iframes but it does not seem to fire.

I tried doing onClientCLick() on the asp.net page and making it break out of the iframe using the following javascript

top.location = self.location.href

But since that sets the location it seems to refresh the page , breaks out of the iframe but does not fire the serverside onclick event which would then perform the backend calculations and do response.redirect.

Any ideas on how I can make sure that the final asp page does not appear inside the iframe and breaks out of it ?

+2  A: 

It sounds like you need to return control to your parent window. You can do this through javascript:

function returnControl(returnPage).
{

  parent.window.location.href = returnPage; 

}
Miyagi Coder
A: 

You can one more thing (Which I have implemented). First call the back end calculations of the onClick event and then redirect the user to another asp.net page which can load the resultant page in the parent window using a javascript function on page load.

Shoban
+1  A: 

I just used a " target=_top" in the link to the main asp page. Works like a charm.

A: 

Just follow the solution given in this post, i follow this and it works. Redirection from IFrame in asp.net

Adeel Fakhar