Hi,
Create the master page with all of the content that will be common across the pages that use that master page (e.g. header, footer, navigation etc.). The asp:ContentPlaceHolder tag is used as a place holder for the content in the master page. The id of the ContentPlaceHolder is used as a reference in the content file.
The content for each page is then created in its own file. Add a MasterPageFile attribute to the page directive which specifies the master file:
- <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="contentpage.aspx.vb" Inherits="contentpage" title="Master page demo" %>
-
This can also be done automatically in VS2005 by ticking the "Select Master Page" option when creating a new web form (the master page must already exist to do this). The content is then placed in an asp:Content tag with the same id as the asp:ContentPlaceHolder that it links to. As the content code is inserted directly into the master page there is no need for any new html, head, body tags as these are already in the master page.
As the ContentPlaceHolder is a server control it must be within the asp form. This means that the code in the head of the final document will be the same in all of the pages that use this page. The links to the CSS stylesheets will be in the head of the document so all of the documents that use the same master page will import the same CSS stylesheets.
Hope this helps