Nested master pages using Razor syntax

I am trying to get nested master pages working with the new razor syntax. Any help appreciated:

The error I get is

Execute() no suitable method found to override

Next, I have my _Site.cshtml, which is the main main page and inherits ViewMasterPage.

My nested main page is _layout.cshtml, which uses _site as a layout, uses some helpers, and inherits from ViewMasterPage

I have _ViewStart.cshtml that points to my layout file.

And finally, I have my index page, which inherits from ViewPage

So, at the top of each page, I have:

Site:

@inherits System.Web.Mvc.ViewMasterPage

Markup

@inherits System.Web.Mvc.ViewMasterPage<MyMasterViewModel>
@{ Layout ="~/Views/Shared/_Site.cshtml"; }

ViewStart

@{ Layout ="~/Areas/AreaName/Views/Shared/_Layout.cshtml"; }

Index

@inherits System.Web.Mvc.ViewPage<MyHomeModel>

Any ideas ???

Hooray!

+3
source share
1 answer

ViewMasterPage WebForms.
Razor ; ViewPage.

@model @inherits .

+2

All Articles