fuzzi
fuzzi

Reputation: 2277

Unable to fix this issue: The following sections have been defined but not rendered for the section

I know this question has been asked frequently on stackoverflow. However, the solutions I have implemented have not fixed this error.

The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_Layout.cshtml": "Scripts".

In my _Layout.cshtml page, I have the following code:

    <footer>
      <p>&copy;</p>
    </footer>


@RenderSection("Scripts", required: false)

All the views I have created are find, however, the Register.cshtml and Login.cshtml, precreated by the asp.net mvc project end with the lines:

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

I have tried taking these lines out, and trying many combinations, nonetheless, the issue has not been fixed.

Any help would be greatly appreciated. :)

Upvotes: 0

Views: 1311

Answers (1)

Andrei
Andrei

Reputation: 56688

Note that you have different case for the first letter in the layout and in page. Section names are case sensitive, so decide on something, say:

@RenderSection("Scripts", required: false)

Upvotes: 2

Related Questions