Fixing the Page Title
n order to realize the value of new features, it helps to discuss the reasoning behind them. I'm going to start by briefly taking you through a few traditional approaches to designing an ASP.NET Web site today, with Microsoft Visual StudioÂ®Â .NETÂ 2003, and I'll place emphasis on some of the pain points that will be removed with Master Pages. I have provided two sample projects that implement User Controls with two different approaches.
To design a Web site with a consistent look and feel you'll typically leverage user controls to design common interface elements. As you add new Web forms to the project, you can easily drag and drop these reusable controls so that each page shares these common elements. In my first example, using Visual StudioÂ .NETÂ 2003 I created a new project, and began by building a header and footer user control to be used on each page. The header control, hdr.ascx, contains a menu and header graphic with a logo. In the designer it looks like this:
Figure1. Design view for the hdr.ascx user control
Then I created a footer control, ftr.ascx, to look like this:
Figure 2. Design view for the ftr.ascx user control
I can place these controls onto each new Web form using drag and drop which generates the control registration tag and an instance of the control on the page. To refresh your memory, after adding a new Web form to the project, and placing the header and footer, it looks like this in the designer:
Figure 3. Before adding content, the design view of a new page consuming the header and footer controls would look something like this.
The HTML source includes two registration tags, and entries within the