- By Penelope Coventry
- Inserting Text, ScreenTips, Hyperlinks, and Images
- Working with Web Parts
- Changing the Home Page for a Web Site
- Modifying a List View Page
- Creating List View Pages
- Creating and Modifying a List Form Page
- Creating an ASP.NET Page
- Inserting a Web Part Zone
- Attaching a Master Page
- Managing Web Pages
- Key Points
Attaching a Master Page
In the previous exercises, you created an ASP.NET page and added a Web Part zone to it, but it did not contain any SharePoint site navigation nor did it inherit any look and feel from the SharePoint site. You can envision the page you created as just the content page. It is not associated with a master page, which is the page that defines the common user interface and code. To attach a master page or to change a master page that a content page is associated with, you must open the page in advanced mode.
Each site has one master page configured as the site’s master page, referred to by using the token ~masterurl/default.master, and then all pages associated with the site’s master page inherit the same look and feel. When a site is created, all pages created for the site point to the site’s master page by using this token. With SharePoint Designer, you can change the master page attached to a page. If a page is not attached to a master page, you can attach the page to the site’s master page or attach the page to a specific master page, such as v4.master.
In this exercise, you attach a page to the site’s master page.
On the Style tab, click Attach in the Master Page group, and then click More Options.
The Select A Master Page dialog box opens.
In the Select a Master Page dialog box, select Default Master Page (~masterurl/default.master) if the option is not already selected.
The Match Content Regions dialog box opens.
Click OK to accept the default setting of associating all the code within the HTML <body> tags of the current page, OfficeFurniture.aspx, to the content region, PlaceHolderMain on the master page.
SharePoint Designer redisplays OfficeFurniture.aspx, which now has a SharePoint look and feel. The HTML <html>, <head>, <body>, and <form> tags are removed from the content page because they are defined in the master page.
On the Quick Access Toolbar, click Save, and then press F12 to review the page in the browser.