Reputation: 272
Given the following directory structure (to keep it simple):
/
_Layout.cshtml
_SubLayout.cshtml
default.cshtml
sub.cshtml
And contents:
sub.cshtml
@inherits ServiceStack.Razor.ViewPage
@{Layout = "_SubLayout";}
<div>In the sub folder.</div>
_SubLayout.cshtml
@inherits ServiceStack.Razor.ViewPage
@{Layout = "_Layout";}
<div>This is a page from a sub section:</div>
@RenderBody()
How can I render the _SubLayout.cshtml view within the _Layout.cshtml view when a request is made for sub.cshtml? When I do this now only the _SubLayout.cshtml is used.
Upvotes: 1
Views: 201