I want to have some default content for a section let suppose Footer. How can I do this.
Also, what if I want to render a partial view as the default content.
Thanks
I want to have some default content for a section let suppose Footer. How can I do this.
Also, what if I want to render a partial view as the default content.
Thanks
Haacked blogged about this http://haacked.com/archive/2011/03/05/defining-default-content-for-a-razor-layout-section.aspx.
@RenderSection("nameOfSection", required: false)
@if (!IsSectionDefined("nameOfSection"))
{
<div>Default section content</div>
}
Haacked blogged about this http://haacked.com/archive/2011/03/05/defining-default-content-for-a-razor-layout-section.aspx.
© 2022 - 2024 — McMap. All rights reserved.