Creating and Modifying Web Pages in Microsoft Office SharePoint Designer 2007

  • 1/9/2008

Creating a Web Page from a Master Page

You can use several different methods to create an ASP.NET page within SharePoint Designer. However, because the page will be part of a SharePoint site, you will most likely want to keep the same navigation elements and look and feel as other pages. This is achieved by linking the content page with a master page. In Chapter 3, you created a new ASP.NET page by copying an existing page that is associated with a master page and then customizing it. In this chapter, you first created an ASP.NET page by using the browser, which again is automatically associated with a master page, and then in the previous exercise, you attached a master page to an ASP.NET page.

You can also create a content page from a master page. As we have seen in previous exercises, most customizations, Web Part zones, and Web Parts are stored within one or more content regions. When you create a content page from a master page, you can’t make any changes to the content regions. To make changes to the content, you must make the content regions editable.

In this exercise, you will create a content page from a master page and then make the PlaceHolderMain content region editable.

  1. In the Folder List task pane, expand the _catalogs folder, and then expand the masterpage (Master Page Gallery) document library to display its contents.

    The default.master file should appear.

  2. Right-click default.master, and then click New from Master Page.

    httpatomoreillycomsourcemspimages1155075.jpg

    A new file, with a tab label of Untitled_1.aspx, appears in the document window. An asterisk to the right of the label name indicates that the page is not yet saved.

  3. Right-click the untitled_1.aspx tab, and then click Save.

    The Save As dialog box opens showing the teams.consolidatedmessenger.com site contents.

  4. In the File name text box, type ShippingAdvice.aspx, and then click Save.

    The tab is renamed to ShippingAdvice.aspx, and in the Folder List task pane, the file appears in the root of the site.

  5. On the View menu, point to Toolbars, and then click Master Page to open the floating Master Page toolbar.

  6. On the Master Page toolbar, click the Regions arrow, and then in the list, click PlaceHolderMain.

    The PlaceHolderMain (Master) content region on the ShippingAdvice.aspx page is highlighted.

    httpatomoreillycomsourcemspimages1155077.png
  7. Close the Master Page toolbar.

  8. Click the chevron to the right of the PlaceHolderMain content region, and in the Common Content Tasks list, click Create Custom Content.

    httpatomoreillycomsourcemspimages1155079.png

    Chevron

    httpatomoreillycomsourcemspimages1155081.png

    The content region is renamed PlaceHolderMain (Custom), thereby making this content region editable. You can now insert text, Web Part zones, and Web Parts into this area of the ShippingAdvice.aspx content page.

  9. Click the Save button.

    httpatomoreillycomsourcemspimages1154873.jpg

    Save