Building a Simple Storefront with LINQ - Creating the Master Page
(Page 3 of 4 )
First, we need to create a master page for our web site. Go ahead and add a new Master Page item to the project. The default name of MasterPage.master will do just fine. Next, add a stylesheet. Again, the default StyleSheet.css name will work. Replace the default master page content with this:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile=
"MasterPage.master.cs"
Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Adventure Works Cycles</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div id="header">
<h1><a id="titleLink" href="Default.aspx">Adventure Works Cycles</a></h1>
<em>Quality Cycles Since 1903</em>
</div>
<div id="main">
<asp:ContentPlaceHolder ID="content" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
And put the following CSS in the stylesheet:
body
{
background-color: #F0FFFF; /* Azure */
color: Black;
margin: 0px;
text-align: center;
width: 100%;
}
#header
{
background-color: #87CEEB; /* SkyBlue */
border-bottom: solid 5px Orange;
margin: 0px;
}
h1
{
margin: 0px;
}
#titleLink
{
color: inherit;
text-decoration: none;
}
#main
{
margin-left: auto;
margin-right: auto;
width: 70%;
}
We've just created a very basic layout and given it a little style-enough for our purposes.
Next: Displaying Product Pictures >>
More ASP.NET Articles
More By Peyton McCullough