In the page:
@section NavLinks {
some content here...
}
In the layout:
<div class="NavLinks">
@await RenderSectionAsync("NavLinks", required: false)
</div>
<div id="MainContent">
@RenderBody()
</div>
<div class="NavLinks">
@await RenderSectionAsync("NavLinks", required: false)
</div>
And results in:
InvalidOperationException: RenderSectionAsync invocation in '/Pages/Shared/_Layout.cshtml' is invalid. The section 'NavLinks' has already been rendered.
Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSectionAsyncCore(string sectionName, bool required)
WebSite.Pages.Shared.Pages_Shared__Layout.<ExecuteAsync>b__14_1() in _Layout.cshtml
+
@await RenderSectionAsync("NavLinks", required: false)
Any ideas how to make it work?
