1

给定以下目录结构(为简单起见):

/
  _Layout.cshtml
  _SubLayout.cshtml
  default.cshtml
  sub.cshtml

和内容:

子.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()

当对 sub.cshtml 发出请求时,如何在 _Layout.cshtml 视图中呈现 _SubLayout.cshtml 视图?当我现在这样做时,只使用 _SubLayout.cshtml。

4

1 回答 1

2

这在 ServiceStack 3.9.54 中受支持

于 2013-06-20T16:06:41.850 回答