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?
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.

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
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

mgfranzCommented:
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

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
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
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
ASP

From novice to tech pro — start learning today.