You can create a RenderSection in layout.cshtml
@if (IsSectionDefined("Sidebar")) { <div id="page"> <div id="content"> @RenderBody() </div> <div id="sidebar"> @RenderSection("Sidebar", required: false) </div> <div style="clear: both;"> </div> </div> } else { <div id="page"> <div id="content2"> @RenderBody() </div> <div style="clear: both;"> </div> </div> }
if you need to see the section in about.cshtml
use
@section Sidebar{ @Html.Partial("_yourbanner") }
If you do not need a banner, do not turn it on
source share