Default Master Pages in SharePoint Foundation
Last modified: October 06, 2009
Applies to: SharePoint Foundation 2010
Master pages define a common structure for all Web pages in Microsoft SharePoint Foundation. By default, when a page is requested, the master page and content page are combined to produce a single page. The page contains the layout elements of the master page along with the content from the content page. By using a master page, all content and application pages share the same page structure and have a consistent look and feel. In previous versions of this product, content and application pages used different master pages. The two types of pages now share the same master page. For more information about application pages that use master pages, see Master Pages on Application Pages.
SharePoint Foundation uses v4.master as its primary master page. All content and application pages use v4.master. When the product is installed, the master pages are located in the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\GLOBAL directory. As long as this master page is not customized, its page definition is cached on the front-end Web server and shared across sites. If the master page is edited for a particular SharePoint Foundation site, the edited copy of the master page file is stored in the content database.
Master pages contain static text and controls that appear on all pages. They also contain one or more ContentPlaceholder controls. Content placeholders define the regions where information that is stored in a content page appears. Custom master pages must have the same controls and content placeholders as the default master page.
The content placeholders for application and content pages are now the same in Microsoft SharePoint Foundation. By having the same content placeholders, content and application pages can use the same master page for a more consistent look and feel across a site.
SharePoint Foundation includes seven pages that use the simplev4.master master page file. These pages render even if the site master page is broken or not accessible to the current user.
In order to customize these pages, a replacement page must be created and stored in the _layouts directory on the server. The UpdateMappedPage(SPWebApplication.SPCustomPage, String) function was added to the SPWebApplication object to map the original simple page and the replacement page. The SPWebApplication.SPCustomPage object defines the page to be replaced with the custom page. The mapping can be retrieved through the SPWebApplication.GetMappedPage function in the object model. A mapping can also be removed by setting the replacement page path to null.