I have a menu bar on layout page and put it in a section on layout.
@section MenuSection{
<ul class="menubar">
<li>Test</li>
<li>Test</li>
<li>Test</li>
</ul>
}
I have multiple view in application associated with layout page. On some views It won't be requiring this menu bar. So I tried hiding section for that view
Index View-
@{
@RenderSection("MenuSection",required:false)
}
But this menu section disappears from layout.
What is the proper way of doing this? Is section is precise way? What would be a definition of section in layout page?