ASP.NET MVC nested master pages
January 6, 2010 | In Development |Creating nested master pages in ASP.NET MVC is straight forward, but slightly different to that in normal ASP.NET.
First, delete the two code behind files.
Second, you need to alter the page header to remove the references to the codefile and alter the inherits.
Change the standard file from:
<%@ Master Language=”C#” MasterPageFile=”~/Views/Shared/Site.master” AutoEventWireup=”true” CodeFile=”Normal.master.cs” Inherits=”Master_Normal” %>
To the following:
<%@ Master Language=”C#” MasterPageFile=”~/Views/Shared/Site.master” Inherits=”System.Web.Mvc.ViewMasterPage” %>