Skip to Main Content
ASP.NET 2.0: A Developer's Notebook
book

ASP.NET 2.0: A Developer's Notebook

by Wei-Meng Lee
June 2005
Intermediate to advanced content levelIntermediate to advanced
348 pages
7h 40m
English
O'Reilly Media, Inc.
Content preview from ASP.NET 2.0: A Developer's Notebook

Chapter 2. Master Pages and Site Navigation

With Visual Studio 2005, ASP.NET now supports visual page inheritance, which is similar to Windows Forms inheritance, for those who have used that popular framework. With ASP.NET 2.0, you can now create a single Master page that contains the common elements used by the pages of your site. You can then create web pages that inherit from the Master page to enforce a common look and feel across your entire site.

Tip

Using Master Pages to provide page headers is preferred over the use of Web User controls; only the Master page needs to be changed and the rest will follow!

In ASP.NET 2.0, a new feature known as Master Pages addresses the limitations of using Web User controls for headers and navigational menu information. In ASP.NET 2.0, you can simply construct a Master page that includes your page header information. You then build each page of your site by first inheriting from the site Master page.

Note

Cool! Now Master Pages make it simple to apply a consistent look and feel throughout my site. No more Web User controls to grapple with!

How do I do that?

To really understand how Master Pages work, you will build a web application using Master Pages in the next couple of labs. In this lab, you will create a Master page and populate it with some controls.

  1. In Visual Studio 2005, create a new ASP.NET 2.0 web application and name it C:\ASPNET20\chap02-MasterPages.

  2. Add a folder named Images to the project (right-click the project name in Solution ...

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

Jumping from ASP to ASP.NET

Jumping from ASP to ASP.NET

Doug Parsons

Publisher Resources

ISBN: 0596008120Supplemental ContentErrata Page