Linking non-frames to frames page

C

cami

My index.htm is non-frames and I need the links to open
pages in the 'main' frame (bottom r in this 3-page frame
case) of a frames page. Is there a way with hrefs and
targets? or do I need to duplicate my frameset with a
different default page for each of the index.htm page's
links?
I have seen a few msg on this, but not convinced yet.

thanx, Cami
 
J

Jim Buyens

-----Original Message-----
My index.htm is non-frames and I need the links to open
pages in the 'main' frame (bottom r in this 3-page frame
case) of a frames page. Is there a way with hrefs and
targets? or do I need to duplicate my frameset with a
different default page for each of the index.htm page's
links?
I have seen a few msg on this, but not convinced yet.

thanx, Cami

This is fairly easy if you can do a bit of ASP programming.

1. Rename your Frames page to have a .asp filename
extension.
2. Add a block of code such as the following to the
<head> section of the renamed frames page.
<%
if request("main") = "" then
mainurl = "dftmain.htm"
else
mainurl = request("main")
end if
%>
3. Change the definition of the "main" frame from
<frame name="main">
to
<frame name="<%=mainurl%>">

After you make these changes, a link such as
<a href="frameset.asp">
will display the frameset showing the dftmain.htm page,
and a link such as
<a href="frameset.asp?url=alt1.htm">
will display the frameset showing the alt1.htm page.

You could also do this with cookies, but it would be a
little messier. Clicking a hyperlink to the frames page
would have to invoke a script that set a cookie and then
loaded the frames page. A script in the frames page would
then look for the cookie and upon finding it, display the
appropriate page.

If this is too much programming, then creating multiple
frames pages may be your only option.

Jim Buyens
Microsoft FrontPage MVP
(e-mail address removed)
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
S

Stefan B Rusynko

Or build dynamic framesets w/ JavaScript
See http://javascript.internet.com/navigation/dynamic-frameset.html

--



| >-----Original Message-----
| >My index.htm is non-frames and I need the links to open
| >pages in the 'main' frame (bottom r in this 3-page frame
| >case) of a frames page. Is there a way with hrefs and
| >targets? or do I need to duplicate my frameset with a
| >different default page for each of the index.htm page's
| >links?
| >I have seen a few msg on this, but not convinced yet.
| >
| >thanx, Cami
|
| This is fairly easy if you can do a bit of ASP programming.
|
| 1. Rename your Frames page to have a .asp filename
| extension.
| 2. Add a block of code such as the following to the
| <head> section of the renamed frames page.
| <%
| if request("main") = "" then
| mainurl = "dftmain.htm"
| else
| mainurl = request("main")
| end if
| %>
| 3. Change the definition of the "main" frame from
| <frame name="main">
| to
| <frame name="<%=mainurl%>">
|
| After you make these changes, a link such as
| <a href="frameset.asp">
| will display the frameset showing the dftmain.htm page,
| and a link such as
| <a href="frameset.asp?url=alt1.htm">
| will display the frameset showing the alt1.htm page.
|
| You could also do this with cookies, but it would be a
| little messier. Clicking a hyperlink to the frames page
| would have to invoke a script that set a cookie and then
| loaded the frames page. A script in the frames page would
| then look for the cookie and upon finding it, display the
| appropriate page.
|
| If this is too much programming, then creating multiple
| frames pages may be your only option.
|
| Jim Buyens
| Microsoft FrontPage MVP
| (e-mail address removed)
| http://www.interlacken.com
| Author of:
| *------------------------------------------------------*
| |\----------------------------------------------------/|
| || Microsoft Office FrontPage 2003 Inside Out ||
| || Microsoft FrontPage Version 2002 Inside Out ||
| || Web Database Development Step by Step .NET Edition ||
| || Troubleshooting Microsoft FrontPage 2002 ||
| || Faster Smarter Beginning Programming ||
| || (All from Microsoft Press) ||
| |/----------------------------------------------------\|
| *------------------------------------------------------*
|
 

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

Similar Threads

Frames Hyperlink 1
getting from a Frames page to non-frame page 2
Getting out of frames 5
Prob with frames 1
Frames page question 3
Blank frames 5
Hyperlinks - frames to non-frames 2
Frames & more 9

Top