c# - How can I know if a non-required RenderSection exists? -
@* omitted code.. *@ @renderbody() @rendersection("sidebar", required: false)
is there way know in omitted code
part if rendersection sidebar
exists or not?
@if (issectiondefined("sidebar")) { @rendersection("sidebar") } else { <div>some default content</div> }
Comments
Post a Comment