April 20th, 2012, 05:32 AM
-
Iframes
Hello.
I am having a problem with iframes. Just starting to learn this feat, so I apologize for any apparent code-idiocy.
Here's a screenshot:
i.imgur.com/9e2H7.jpg (cannot post links, yet)
And the code I deem important for the problem:
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
<!--- Menu --->
<iframe id="menu" name="menuWindow" src="menu.aspx" height="224px" width="113px" frameborder="0" scrolling="no" ></iframe>
<iframe id="main" name="mainContent" src="default.aspx" height="640px" width="672px" frameborder="0" scrolling="no" ></iframe>
The menu.aspx:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<a id= "menuNews" href="default.aspx" target="mainContent"></a>
<a id= "menuInfo" href="info.aspx" target="mainContent"></a>
<a id= "menuContact" href="contact.aspx" target="mainContent"></a>
<a id= "menuLinks" href="links.aspx" target="mainContent"></a>
</asp:Content>
The relevant CSS:
#main
{
background-image:url("../graphic/content.png");
height:640px;
width:672px;
position:absolute;
left:25%;
top:30%;
}
#menu
{
position:absolute;
top:30%;
left:15%;
}
My question is, why does it keep copying itself and why isn't the default.aspx not showing.
Furthermore, when I click a link they are showed in the menu iframe and not the target I defined.
Thanks in advance,
Mowinckel
-
It should work as you described. But instead of <asp:Content use <asp:PlaceHolder
You need index.aspx with following code
<!--- Menu --->
<iframe id="menu" name="menuWindow" src="menu.aspx" height="224px" width="113px" frameborder="0" scrolling="no" ></iframe>
<iframe id="main" name="mainContent" src="default.aspx" height="640px" width="672px" frameborder="0" scrolling="no" ></iframe>
menu.aspx with your menu
and all the content pages
Michael