How to fix the error 'The following sections have been defined but have not been rendered for the layout page...'

Posted written by Paul Seal on January 18, 2017 .NET Framework

This post shows you how to solve the error:

The following sections have been defined but have not been rendered for the layout page "~/Views/Master.cshtml": "Head; ScriptsBottom; etc; etc".

In the view which it specifies in the error you need to add a section like this:

@RenderSection("Head", false)

Where "Head" is the name of the section and false means it's not enforced on any views below it. You can set it to true if you want.

Do this for each of the section names that come after the view path.