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” %>

No Comments yet

TrackBack URI

Sorry, the comment form is closed at this time.

Login | XFN| WP
Powered by WordPress with cmb-web Theme design by Christian Bridge-Harrington.
Blog feed. Valid XHTML and CSS. ^Top^