Using ASP.NET Master Pages
The first approach to styling we will explore is the ASP.NET master page feature, which lets us apply a common design to pages using a system of templates. The master page feature is the reason we created an ASP.NET Web Application project, instead of the ASP.NET Empty Web Application we have relied on so far; when using this type of project, Visual Studio creates some default pages that use the master page feature. If you open the Default.aspx
file and look at the markup, you will see that it has a different structure from the web pages we have seen so far, as illustrated by Listing 9-1.
Listing 9-1. The Default.aspx file
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" ...
Get Applied ASP.NET 4 in Context now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.