I got a view with Layout defined. In the layout, there is a section:
@RenderSection(\"JavaScript\", required: false)
In the view, based on a c
@if(condition) RenderSection(..)
@Section Javascript{ } }
also see: Is there a way to make a @section optional with the asp.net mvc Razor ViewEngine?