ASP.NET Podcast Show #99 - Nested Master Pages in Visual Studio 2008 - More Wally - Wallace B. McClure
in

MoreWally.com

Giving people what they want, More Wally. This is the technical and personal blog site of
Wallace B. (Wally) McClure.

This Blog

Syndication

News

Please goy buy 3-4 copies of my book on MonoTouch titled "Professional iPhone Programming with MonoTouch for .NET/C# Developers." They make great gifts all year round. Plus, I get about $.20 when you buy a copy.

Technical Sites

More Wally - Wallace B. McClure

This blog will have all kinds of posts about Wally McClure. In it, there will be tons of .NET and computer programming posts as well as Wally's views on life in general. As you might guess, this site and blog help you get More Wally in your life. What more could anyone want? iPhone, Android, MonoTouch, MonoDroid, Mobile, HTML5, .NET, ADO.NET, ASP.NET, AJAX, Atlas, Microsoft AJAX Library, ASP.NET AJAX, and Windows Azure............follow me on twitter at Wally

ASP.NET Podcast Show #99 - Nested Master Pages in Visual Studio 2008

Subscribe <-- What everyone wants.

Original url: http://aspnetpodcast.com/CS11/blogs/asp.net_podcast/archive/2007/08/22/asp-net-podcast-show-99-nested-master-pages-in-visual-studio-2008.aspx

Download as WMV

Download as M4V for iPod and Zune

Download as MP3 audio only

Show Notes:

This show is a video demo of creating a nested master page in Visual Studio 2008.

The source code for the parent master page is:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPageParentSimple.master.cs" Inherits="MasterPageParentSimple" %>

<!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>Untitled Page</title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        Simple Parent Master Page.<br />
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
       
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

The source code for the example child master page is:

<%@ Master Language="C#" MasterPageFile="~/MasterPageParentSimple.master" AutoEventWireup="false" CodeFile="MasterPageChildSimple.master.cs" Inherits="MasterPageChildSimple" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    Simple Child Master Page<br />
    The location of the ContentPlaceHolder was the one hangup I had.<br />
    <asp:ContentPlaceHolder ID="Content3" runat="server">
    </asp:ContentPlaceHolder>
</asp:Content>

The source code for the example simple out page is:

<%@ Page Language="C#" MasterPageFile="~/MasterPageChildSimple.master" AutoEventWireup="true" CodeFile="DefaultSimpleMasterPageExample.aspx.cs" Inherits="DefaultSimpleMasterPageExample" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content3" Runat="Server">
    this is some basic content. this is more content.
</asp:Content>

Here is some exact output (not a perfect match, but close).

Nested Master page output

If you want to see some more on nested master pages, check this post out:

http://morewally.com/cs/blogs/wallym/archive/2007/08/09/visual-studio-2008-thursday-august-9-2008.aspx

Comments

No Comments
2006 - Wallace B. McClure
Powered by Community Server (Non-Commercial Edition), by Telligent Systems