redirecting within frameset

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

Steve C. Orr [MVP, MCSD]

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

Alex Papadimoulis

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top