I can not seem to get this to work.
@if (isReal)
{
@section Navigation{
@{Html.RenderPartial("NavigationForInput");}
}
}
that doesn’t work because it says “once inside code you dont’ need @ blah blah blah”
but, when I remove the @ from in front of section, it wants to use section as a type variable.
how can I only show that section conditionally?
Depending if your Layout has an alternative for undefined sections or not, you could just reverse the
@ifand@sectionIf you just want to leave out the nav, this should be fine, but it won’t work if you are using IsSectionDefined(“Navigation”) in your layout, as it will always return true.