Hi,
I am trying to get a very basic page that uses a master page up and running. I have got some CSS that divides the screen up into a header, left, right and footer section and the header section has an include which has a logo and shows the day and date.
The thing I don't really understand is how I use the page master. If the divs have already been set up then do I still need to add them again on my non master page?
Here is my code so far. So just to clarify... what I am trying to do is have the default.aspx load and then for the text Hello World to appear in the area defined by the right div.
MasterPage.Master
Default.aspx
styles.css
Thanks very much
Ed
I am trying to get a very basic page that uses a master page up and running. I have got some CSS that divides the screen up into a header, left, right and footer section and the header section has an include which has a logo and shows the day and date.
The thing I don't really understand is how I use the page master. If the divs have already been set up then do I still need to add them again on my non master page?
Here is my code so far. So just to clarify... what I am trying to do is have the default.aspx load and then for the text Hello World to appear in the area defined by the right div.
MasterPage.Master
Code:
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="dotnet_masterpages_MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head runat="server">
<title></title>
<link href="../../styles.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div id="header">
<!--#include virtual="/dotnet/banner.aspx"-->
</div>
<div id="wrapper">
<div id="left"></div>
<div id="right"></div>
</div>
<div id="footer">
</div>
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
Default.aspx
Code:
<%@ Page Title="" Language="VB" MasterPageFile="~/dotnet/masterpages/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="dotnet_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
styles.css
Code:
*{margin:0px;padding:0px;overflow:hidden}
body{top:0xp;left:0px;}
div{position:absolute;}
div#header{top:0px;left:0px;right:0px;height:61px;border-bottom:1px dotted gray;}
div#wrapper{top:62px;left:0px;right:0px;bottom:30px;}
div#right{top:0px;bottom:0px;left:17%;width:83%;overflow-y:auto;}
div#left{top:0px;bottom:0px;left:0px;width:17%;overflow-y:auto;background-color:#E6E6E6;}
div#footer{bottom:-1px;left:0px;width:100%;overflow:hidden;height:30px;border-top:1px gray dotted;background-color:#BDBDBD;}
Thanks very much
Ed