O'Reilly logo

Applied ASP.NET 4 in Context by Adam Freeman

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

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" ...

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