Master Pages and Content Pages in WSS 3.0

This short article demonstrates the use of ASP.NET 2.0 master pages and content pages in Windows SharePoint Services v3.0. Since WSS 3.0 uses ASP.NET 2.0 to provide core functionality, it is worth documenting how SharePoint builds upon the master/content page concept to provide site customization.

The web hosts many articles, which explain the concept of master pages. The following link provides access to an article, from MSDN magazine, which is a good primer on master page technology. This article assumes the reader has some prior knowledge on web site construction in ASP.NET 2.0, using master pages.

The Global Master Page

Master pages allow multiple levels of nesting. All sites in SharePoint use the default.master master page located in the C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATEGLOBAL directory. This default master page is the global master page. Any changes made to the global master page file will affect all sites in SharePoint, even the central administration web site.

Master Page Editing in SharePoint Designer

The SharePoint Designer is the replacement for the legacy Front Page tool. SPD allows designers to customize the look and feel of SharePoint web sites using a rich UI editor. After opening a SharePoint web site, the folder list in SPD (top left) displays the various pages, lists, and templates that participate in the construction of the site just opened. The site master page is located at _catalogs/masterpage/default.master.

Looking at the site master page in the designer, the XHTML markup is identical to that of the global master page. This is because they are actually the same file prior to any edits. Making a change to the site master page, followed by a save operation, causes SPD to create a customized version of the master page in the SharePoint database – this is referred to as page customizing, or un-ghosting. When customizing a page, the physical disk file is left untouched, and the database contains the customizations made to the site.

Note: Any changes made to the site master pages will affect all pages in the site, with the exception of pages in the _layouts directory. These pages are non-site specific, and use a different master page (also located in the _layouts directory). On example page that is non-site specific, is the “settings” page.

The SharePoint Designer now allows designers to revert customized pages back to the template version – a feature that was much desired in Front Page. A right click on the customized file presents a context menu that includes this option.

Content Pages

Content pages in SharePoint link to the template master page via the MasterPageFile attribute in the Page declaration. The URL to the default master page is typically ~masterurl/default.aspx. The ~masterurl refers to the location of the site master page, which is managed by SharePoint.

The master pages in SharePoint define a number of content placeholders. These content placeholders define areas on pages in which developers can customize the content. SharePoint defines default content for most of the placeholders not overridden by users.

Most SharePoint pages contain a PlaceHolderMain placeholder where the bulk of the main content lives. Typically, this placeholder will contain a web part zone for dropping web parts, but developers are free to place anything they like.

Content placeholders defined in SharePoint master pages are as follows:

Name of Content Placeholder



Additional content that needs to be within the <head> tag of the page, for example, references to script in style sheets


Additional body styles in the page header


Border element for the main page body


Right margin of the main page body


Shows a date picker for navigating in a calendar when a calendar is visible on the page


The “form digest” security control


The global navigation breadcrumb


Top navigation menu for the page


Bottom of the left navigation area


Left navigation area


Border element on the left navigation bar


Data source for the left navigation menu


Top of the left navigation area


Page’s main content


A place to show page-level commands, for example, WIKI commands such as Edit Page, History, and Incoming Links


The width of the left navigation area


Description of the page contents


Page icon in the upper left area of the page


The page <Title> that is shown in the browser’s title bar


Search box area


Site name


Additional styles in the page header


Shows shadows for the title area


Main content breadcrumb area


Page title shown immediately below the breadcrumb


Left border of the title area


Right margin of the title area


Top navigation area


Extra content that needs to be at the bottom of the page


Empty by default in Windows SharePoint Services Used for additional page editing controls


The page editing controls when the page is in Edit Page mode (after clicking Site Actions, then Edit Page)