
Adding Elements to the Parent Master Page
At the top of the master page is an @ Master declaration instead of the @ Page declaration that is ordinarily found at the top of ASP.NET pages. The body of the page contains a ContentPlaceHolder control, which is the area of the master page where replaceable content will be merged with content pages at run time. You will work more with content placeholders later in this walkthrough.
Adding Graphics to the Parent Master Page
Before you can incorporate graphics into the parent master page, you have to add the graphic files to the Web site.
Create a graphic that is 780 pixels wide and 150 pixels in height for the banner and a graphic that is 780 pixels wide and 50 pixels in height for the footer. The graphics are used to show how graphics on the parent master page will appear in a nested master page. If you do not have these graphics, you can create them in Microsoft Paint or another graphics program.
To add an existing graphic file to the Web site
In Solution Explorer, right-click the name of the Web site, and then click Add Existing Item.
The Add Existing Item dialog box is displayed.
Select the graphic files that you created.
Click Add.
On the parent master page, you add two simple graphics, one for a banner and the other for a footer. These graphics let you see that the parent master page is being used in the nested master pages that you will create later in this walkthrough.
To add banner and footer graphics to the parent master page
In Source view, immediately after the opening <form> tag, add a div element that contains an img element for the banner graphic.
For example, if you created a graphic named Banner.gif, the markup to add this graphic would resemble this:
<div id="banner">
<img src="banner.gif" alt="banner graphic" />
</div>
Immediately before the closing </form> tag, add a div element that contains an img element for the footer graphic.
For example, if you created a graphic named Footer.gif, the markup to add this graphic would resemble this:
<div id="banner">
<img src="footer.gif" alt="footer graphic" />
</div>
Save the master page.
Notice that you have not added anything inside the ContentPlaceHolder control. The next set of master pages that you create will be inside the ContentPlaceHolder control.