O'Reilly logo

Learning ASP.NET 2.0 with AJAX by Dan Hurwitz, Jesse Liberty, Brian MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Master Pages

A master page acts as a shell or frame shared by all the other pages (or some of the other pages)on your site. It is common to put a logo and perhaps a menu into the master page so that these elements appear at the same location on every page without your having to recode them.

This is what the AspNetExternalStyles page looks like in your browser. You need to include the @import statement in your page so that the styles are loaded along with the page content.

Figure 6-4. This is what the AspNetExternalStyles page looks like in your browser. You need to include the @import statement in your page so that the styles are loaded along with the page content.

Within the master page, you place one or more content placeholder areas, which will be filled with the contents of each of the child pages. This is shown in Figure 6-5.

Tip

Unlike cascading style sheets (CSS), which help ensure that similar controls have similar appearances (see the previous section), master pages ensure that all the pages on your site have common elements such as logos, headings, footers, or navigation aids.

To use master pages, follow these steps:

  1. Create a new web site.

  2. Add a master page to the site.

  3. Add content pages based on the master page.

The master page defines the content that should appear on every page of your site, and has placeholders for the content of the individual child pages. When you put them together, you get a web site with a uniform appearance.

Figure 6-5. The master page defines the content that should appear on every page of your site, and has placeholders for the content of the individual child pages. When you put them together, you get a web site with a uniform appearance.

Creating a Master ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required