布局

<body>

<div id="main-content">@RenderBody()</div>

<footer>@RenderSection("Footer")</footer>

</body>

引用上述模版的时候,

<p>this is the main Content</p>

@section Footer{

  this is the <strong>footer</strong>

}

默认情况下,视图必须为布局中定义的每一个节 提供内容。

RenderSection()可以重载,允许指定不需要的节。

也可以为没有定义的节定义一些默认内容

原文地址:https://www.cnblogs.com/dotnetHui/p/7908858.html