Skip to Main Content
ASP.NET 4 24-Hour Trainer
book

ASP.NET 4 24-Hour Trainer

by Toi B. Wright
July 2010
Beginner content levelBeginner
552 pages
10h 14m
English
Wrox
Content preview from ASP.NET 4 24-Hour Trainer

Chapter 11. Master Pages

Many pages on a web site share common elements. For example, most pages on a web site share a header, some type of page navigation, and a footer. Master pages are used to store the shared elements on your page in one location. They enable you to create a consistent look and feel for your web application. In this lesson I illustrate some of the shared sections of a web page and explain how a generic master page works.

Figure 11-1 shows a typical web page with a header, a menu for navigation, some content, and a footer.

FIGURE 11-1

Figure 11.1. FIGURE 11-1

Figure 11-2 points out the different sections of the page.

The best way to lay out your web pages is to use a cascading style sheet. The first thing that I do when I am creating a new web site is to lay out a sample page using HTML. The page shown in Figure 11-1 used the following HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="header">
    </div>
    <div id="navigation">
        Top-Level Menu
    </div>
    <div id="content">
        Content goes here.
    </div>
    <div id="footer">
        Copyright © 2010 Super Easy Recipes. All rights reserved.
    </div>
    </form>
</body>
</html>

Figure 11.2. FIGURE 11-2

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 4 24-Hour Trainer

ASP.NET 4 24-Hour Trainer

Toi B. Wright
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9780470596913Purchase bookExamplesErrata