Jun 20, 2008

Master Page

Content Page's Master Page

Dynamic Master Page

Dynamic Master Page is to control what master marge to be used by variable or property, so if you change the property, then the dynamic page is changed.

  1. System Master Page

    Page language="C#" MasterPageFile="~masterurl/default.master"

    Property of "spweb.MasterUrl" is used to represent this token. It is most frequenet used Master page. We use the system master page for all forms and view pages in this site.

  2. Site Master Page

    Page language="C#" MasterPageFile="~masterurl/custom.master"

    Property of "spweb.CustomMasterUrl" is used to represent this token.The site master page will be used by all publishing pages

Although WSS 3.0 sites do not utilize the SPWeb.CustomMasterUrl property, MOSS 2007 publishing sites make heavy use of it. All page layouts are automatically configured to use the master page defined in the SPWeb.CustomMasterUrl property when rendering the site. The master page defined in SPWeb.MasterUrl property is till used for standard SharePoing Pages such as list or form pages.

Static Master Page

~sitecollection/default.master or ~site/default.master they are not variable so you can not change it, they static point to a physical relative url.The first part is considered a replaceable token. At runtime, sharepoint evaluate the first part of the token and replace it with url specified, but it will not change the anem of the master page. For example if a content page is within the site http://site/subsite, Sharepoint will would switch the "~site" token out at runtime to "/subsite".

Application Page's Master Page

Application's Page are served by the files in file systems. It can not use all the token used above. Default master page for application page is

MasterPageFile="~/_layouts/application.master"