Redirect - Target Frame

I have a page with two frames, on of the frames has a form on it. On submitting the form I call an asp page that processes the form and the redirects to another page.

The problem I have is that new page appears in the frame in which the form was. I want to replace both frames, I want the page I am redirecting to, to be the new parent page.
MisterMartAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mgfranzConnect With a Mentor Commented:
You could also simply target the new page;

<form method=post action=process.asp target=_top>

Or as;

window.open()
document.myForm.target=_top
0
 
FRehmanCommented:
I will tell you later on
0
 
Yury_DelendikCommented:
You may generate that page after asp processed data:
<html><body onload="window.open('another_page.asp', 'parent_target');"></body></html>

or if you want pass any data to "another page" use:

<html><body onload="document.forms.mf.submit();">
<form name=mf id=mf action="another_page.asp" target="parent_target" method=post>
<input type=hidden name=dataname value=data>
</form></body></html>
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
TTomCommented:
If your "return page" is intended ALWAYS to be in its own window, you can add code to that page:

<script>
if (top.location != self.location) {
   top.location = self.location
}
</script>

Your ASP will redirect your page to the frame, but the page will then "break out" of the frameset when it realizes it is not in the top frame.

Should accomplish what you want.

Tom
0
 
TTomCommented:
Mark:

Ah!  Could be very slick.  The form will post to the top frame and then the redirect (in the action page) will post there?

Sounds good to me.

Tom
0
 
mgfranzCommented:
In reading the original question I am a bit confussed...  You have a frameset of two frames, lets call them Left and Right.  In the left frame there is a form page that needs to be processed.  In the Right frame is to be the results of the form process, (correct?).  If this is the case, then a simple answer would be the;

<form method=post action=process.asp target=Right>

However, this line confusses me, "I want to replace both frames, I want the page I am redirecting to, to be the new parent page"

Mark
0
 
TTomCommented:
Mark:

My reading of the question is that the form (in the left frame) is being submitted to an ASP which does a response.redirect.  Normally, that will put the redirected page back into the original frame, since ASP has no knowledge of framesets or frames.

I think MisterMart wants to replace both frames with a single document.

<form method=post action=process.asp target=_top> might work, but the code I provided will "bust" the frameset and send the page to the top in any case.

I guess we'll see what seems to work for MM.

Tom
0
 
mgfranzCommented:
The target=_top will replace any and all framesets that may be loaded as will (I assume) your top.location solution.  
I still am confused with how the page results are suppose to be layed out.

M
0
 
jamestthomasCommented:
I had to do this exact thing.  In order to "break" the frameset, I wrote  Javascript function that fired on a button click event.
<script language="javascript">
<!--
function framebreak()
{
      window.open("utility.asp","_top") ;
}
//-->
</script>

good luck Mister Mart
0
 
MisterMartAuthor Commented:
Cheers
0
All Courses

From novice to tech pro — start learning today.