Frames

P

Peter

I have 3 frames on a web page and using C#

<frame name="left" src="SideMenu.aspx" scrolling="no" noresize style="BACKGROUND-COLOR: #ffffcc">
<frameset rows="16%,84%">
<frame name="rtop" src="TopMenu.aspx">
<frame name="rbottom" src="MainScreen.aspx">
</frameset>


I am trying to display another page in the rbottom frame when I click on the link in the left frame. How do I do that? Does anyone has an example?

Peter
 
M

MSFT

Hi Peter,

Thank you for using Microsoft Newsgroup service. Based on your description,
your have a group of web pages arranged in a frameset. The frameset has a
left and a right area and the right area has its own two sub
frames(rtop|rbottom), just like:
-------------------------------------------------------------------------
| | |
| | rtop |
|left |-----------------------------------------------|
| | |
| | |
| | rbottom |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
-------------------------------------------------------------------------
Please correct me if my understanding of your problem is not quite accurate.

If so, here is my suggestion:

To generate a such style framesets, you can code as this in the main
frameset page:

<frameset id="fsleft" cols="20%,80%">
<frame name="left" src="SideMenu.aspx" scrolling="no" noresize
style="BACKGROUND-COLOR: #ffffcc">
<frameset id="fsright" rows="16%,84%">
<frame name="rtop" src="TopMenu.aspx">
<frame name="rbottom" src="MainScreen.aspx">
</frameset>
</frameset>


there are two framesets in it. One is for the left|right outer frameset,
the other is for the top|bottom inner frameset in the right area. And there
are three pages set for the three frames' src. Notice that every frame
should be specified a "name" so that you can use it as the "target" for a
Navigator link. Then, if you want to set a hyperlink in the "left" frame
and let the link's page shown in the "rbottom" frame. You can write the
link as this:

<a href="http://www.asp.net" target="rbottom">ASP.NET</a>
the "target" attribte just specified that in which location will the linked
page shown.


Please try out the preceding suggestion to see whether it helps.


Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
P

Peter

Thanks for your help, this is what I wanted to do!

But now how do I do the same thing from a server control like a button on
the Web form?

Thank you.
 
H

Hermit Dave

you need to use hyperlink object but that renders as plain html < a
href="blah blah blah" target="loadmeup"> with no server side events

Hope this helps,

HD
 
P

Peter Row

Hi,

Haven't much used ASP.NET controls but couldn't you just set the buttons
onclick event to
change the location property of the rbottom frame using JS.

So in that case you wouldn't even use an ASP.NET button, just a standard
HTML one.

Regards,
Pete
 
M

MSFT

Hi Peter,


Thank you for the prompt response. As for the question you mentioned in the
reply, I agree to Peter Row's suggestion , you can just use a html button
like:
<input type="button value="navigator to other place"/>
Thus, you can use client side javascript to specify the operation when the
button is clicked, you needn't write serverside code(the client side code
will be much more quick since the page doesn't need to post back to
server). For example:

In the "SideMenu.aspx" page, you can use a javasciprt function to let a url
opened in a certain frame, and set the html button's "onclick" event as the
function.

<html>
<head>
.....
<script language="javascript">
function JumpTo( url, tar)
{
window.parent.rbottom.location.href = url
}
</script>
.....
</head>
<body>
.......

<input type="button" value="jump to other place"
onclick="JumpTo('http://www.asp.net')" />
...........
</body>
</html>

the "window.parent.rbottom.location.href = url" is used to set the page(in
the rbottom frame)'s url location. In a set of frames which have the same
parent frame can find each other via "window.parent.framename". As the
same, you can use "window.parent.left" to find the "left" frame in the
"rbottom" frame's page's client javascript code.


Please try out the suggestion to see whether it helps. Also if you have any
questions on it, please feel free to let me know.


Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Steven Cheng[MSFT]

Hi Peter,

Have you had a chance to try out my suggestion or is your problem resolved?
If you have any questions please feel free
to let me know.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,089
Latest member
Ketologenic

Latest Threads

Top