0

I have created a standard hosted wasm with local authentication added.

I have also added the scaffold items for identity (add > scaffold > Identity - specify the _layout specify the dbcontext and select account/login and account/logout items)

This created some scaffold pages in areas/identity/pages/account - login.cshtml and logout cshtml

on rebuilding the solution and running I now get an error when navigating to the login page:

InvalidOperationException: The following sections have been defined but have not been rendered by the page at '/Pages/Shared/_Layout.cshtml': 'Scripts'. To ignore an unrendered section call IgnoreSection("sectionName").

on further testing this relates to the following script block on the login.cshtml file

@section Scripts {
    <partial name="_ValidationScriptsPartial" />
}

if i delete this then the error goes away - but it seems it is intended to include various scripts in the _ValidationScriptsPartial.cshtml file so I am concerned I am losing something.

Any thoughts on how to get the @section Scripts{} block working appropriately.

note - i have tried this on 3 different solutions 2x ones i have pissed about with and 1x brand new boilerplate vs2019 solution.

help very much appreciated.

1 Answer 1

1

Try adding the following to _Layout.cshtml just before the closing </body> tag in the server project:

@RenderSection("Scripts", required: false)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.