Creating a Nested Master Page - Nested Master Project
(Page 2 of 4 )
The following picture shows the files in the NestedMaster project. If you associate this file structure with the schematic shown in the next sub-section you will immediately notice the way the aspx files will be displayed.

The next picture shows schematically the arrangement of the pages and the relationship between them in the context of how they get displayed. In the rest of the tutorial the code listing and the screen shots are related to the file structure and the schematic arrangement shown.
There is one master page, the top.master, which has some content of its own. This is displayed by the MPage.aspx.

Code for top.master
<%@ Master Language="VB" CodeFile="top.master.vb" Inherits="top" %>
<!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 runat="server">
<title>Nested Master With Two Children</title>
</head>
<body>
<form id="form1" runat="server">
<h2 style="color:Maroon">Welcome to a Nested Master</h2>
<div>
<asp:contentplaceholder id="ContentPlaceHolder1"
runat="server">
</asp:contentplaceholder>
</div>
<h4 style="font-style:italic; color:Maroon;">
This was designed by Jay Krishnaswamy </h4>
</form>
</body>
</html>
Code for MPage.aspx
<%@ Page Language="VB"
AutoEventWireup="false"
CodeFile="Mpage.aspx.vb"
Inherits="Mpage"
MasterPageFile="~/top.master" %>
<asp:Content ID="content1"
ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
<h3 style="color:Blue;"> Welcome to the Visual Basic .NET Tutorials
</h3>
</asp:Content>
Next: Embedded master pages >>
More ASP.NET Articles
More By Jayaram Krishnaswamy