redirecting within frameset

  • Thread starter Thread starter Serge L
  • Start date Start date
S

Serge L

Ok, I have Main.htm page which contains:
<frameset rows="20%,80%">
<frame scrolling="no" name="top" src="ONE.aspx">
<frame scrolling="yes" name="bottom" src="MAIN.aspx">
</frameset>
and I have another webform TWO.aspx

So the top frame (one.aspx) contains action buttons and
bottom frame is for display purposes.

So when user clicks button on ONE.aspx I use:
Server.Transfer("TWO.aspx")

I would like TWO.aspx to replace MAIN.aspx on the bottom,
but instead TWO.aspx replaces ONE.aspx on top.

Is there any elegant way to do this?

Thank you.
 
This is one of the many reasons that using frames in .NET is generally a bad
idea.
Usually you're better off partitioning logical sections of your page into
web user controls.
Here's more info:
http://msdn.microsoft.com/library/d...n/html/vbconintroductiontowebusercontrols.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriwebusercontrols.asp
http://msdn.microsoft.com/library/d...l/vbconWebUserControlsVsCustomWebControls.asp

If you must stick with frames then you'll need to use client side javascript
to accomplish your goal.
 
Hi Serge,

I agree with Steve C., however there are a lot of times when frames are the
best solution. In anycase, a server.transfer won't work.

You can use a regular link:
<a href="two.aspx" target="bottom"> ...

Or some javascript:
parent.bottom.location='two.aspx';

If you want to register the javascript in your codebehind, then check out
RegisterStartupScript function.

-- Alex Papadimoulis
 
Back
Top