| West Wind Web Store .NET 2.0 |
Master Page Layout
|
The easiest way to see what this 'template' looks like is to open up any of the public pages in the VS.Net editor:

The page is layed out with three user controls and a 'content' table. The three controls are:
The page content table is simply a table with two columns the first of which contains the CategoryList user control that renders the links for the store and the list to the various categories. The header and footer controls are very simple literal controls. The Category list is a bit more involved and calls on the Business objects to provide the category listing.
The main portions - the header, the table, category list and footer are the same on every page and are simply cut and paste into each new ASPX page. Merely the content varies between each of the pages. The content area is generally just a cell in the table.
The end result is a complete page that looks like this:

<%@ Page language="c#" Codebehind="ItemList_Abstract.aspx.cs" AutoEventWireup="false" Inherits="Westwind.WebStore.ItemList_Abstract" %> <%@ Register TagPrefix="ww" TagName="PageFooter" Src="PageFooter.ascx" %> <%@Register TagPrefix="ww" TagName="CategoryList" src="CategoryList.ascx"%> <%@Register TagPrefix="ww" TagName="PageHeader" src="PageHeader.ascx"%> <html> <head> <title>Item Listing - <%= this.CategoryName %></title> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <link href="wwWebstore.css" type="text/css" rel="stylesheet"> </head> <body leftmargin="0" topmargin="0"> <!-- West Wind Menu --><ww:pageheader id="oMenu" runat="server"></ww:pageheader> <table class="body" height="100%" cellspacing="0" cellpadding="0" width="98%" border="0"> <tr> <td class="categorylistbackground" valign="top"><br> <form action="ItemList.aspx" method="get"> <ww:categorylist id="oCategoryList" runat="server"></ww:categorylist></form> </td> <td valign="top" align="left" width="34" bgcolor="white"> </td> <td class="body" valign="top" bgcolor="#ffffff"> <!-- Custom Form Stuff --> <form id="Form1" runat="server"> <br> <h2><%= this.CategoryName %></h2> <hr> <p></p> <center><asp:label id="lblError" cssclass="errormessage" forecolor="Maroon" runat="server"></asp:label></center> <asp:datagrid id="dgItemList" runat="server" onpageindexchanged="dgItemList_OnPageIndexChanged"> ... rest of the datagrid code ommitted here> </asp:datagrid> <p> <ww:pagefooter id="PageFooter" runat="server"></ww:pagefooter></p> <p> </p> </form> </td> </tr> <!-- End Custom Form Stuff --> </table> </body> </html>
Note the control loading headers as well as the use of the wwWebStore.css style sheet loaded in the header. The template layout of the page should be visible in the ASPX/HTML code above - the specific page content is created inside the Custom Form Stuff comment blocks.
But there's no specific logic in this class that fires. Each page essentially handles its own logic via the Page_Load or individual control events that fire in response to pages.
We'll look at the code and layout of the individual pages and controls next.
Last Updated: 1/10/2004 |
Send topic feedback