Are there nested master pages in ASP.NET MVC?

I wanted to know if the MVC framework can leverage the Nested Master Page? If so does anyone have some info on how to achive this?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

We use nested master pages frequently, in order to seperate layout from standard includes and site wide markup, like so:


<%@ Master Language="C#" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewMasterPage<PageViewModel>" %>

<!DOCTYPE html>
<html lang="en">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="language" content="en">
    <title><asp:ContentPlaceHolder ID="Title" runat="server"><%= Model.Page.Title %></asp:ContentPlaceHolder></title>

    <% Html.RenderPartial("Head"); %>

    <meta name="robots" content="index, follow">
    <meta name="robots" content="noodp">
    <asp:ContentPlaceHolder ID="ExtraHead" runat="server"></asp:ContentPlaceHolder>
<body >

    <asp:ContentPlaceHolder ID="MainContent" runat="server"></asp:ContentPlaceHolder>


then have a another master using the Site.Master,


<%@ Master Language="C#" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewMasterPage<PageViewModel>" MasterPageFile="Site.Master" %>
<asp:Content ContentPlaceHolderID="ExtraHead" runat="server">
    <asp:ContentPlaceHolder ID="ExtraHead" runat="server"></asp:ContentPlaceHolder>

<asp:Content ContentPlaceHolderID="MainContent" runat="server">

            <asp:ContentPlaceHolder ID="MainContent" runat="server"></asp:ContentPlaceHolder>


Method 2

Yep. I just saw a blog post about this at:

Very cool stuff.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x