1
votes

I have the following setup

  1. LayoutBasic.cshtml defining my head and body section + a @RenderSection("Extra", required: false);
  2. LayoutTabPage.cshtml using LayoutBasic.cshtml defining the layout of a tab page
  3. SpecificTabPageIndex.cshtml using LayoutTabPage.cshtml defining a @section Extra{} with some link and style tags
  4. Sometimes I have a partial that contains the @section Extra{} rendered from within the SpecificTabPageIndex.cshtml

The problem is that it that the "Extra" section is not rendered. Sometimes the code runs fine but the section is not rendered and sometimes I get the "The following sections have been defined but have not been rendered for the layout page" error.

Can anyone give me a hint as to what I'm doing wrong? Is RenderSection unusable when nesting layouts in as many levels as I do?

TIA

./kroogar

1

1 Answers

1
votes

Sometimes I have a partial that contains the @section Extra{}

Partials cannot have sections. That is a non supported scenario.