Click here to Skip to main content
15,498,859 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,
I am using asp.net core 5.0.12 with react selected the inbuild authentication for individual everything working login register.

I want to add roles for the authentication for register and login form but the design for the UI of login, register is not there tried searching a lot got a method in which they say to scaffolding the identity this way I get blazor code I think like in MVC project,

But when I try to run the login part of it I get error
An unhandled exception occurred while processing the request.
InvalidOperationException: The following sections have been defined but have not been rendered by the page at '/Areas/Identity/Pages/Account/Manage/_Layout.cshtml': 'Scripts'. To ignore an unrendered section call IgnoreSection("sectionName").


What I have tried:

I had followed the steps from Microsoft website to which they give link in ScaffoldingReadMe.txt file which is generated
Scaffold Identity in ASP.NET Core projects | Microsoft Docs[^]

Which I tried many times but getting save some solution say have add @RenderScript("scripts",false) in layout.cshtml
but that file doesn't exist in asp with react I got _LoginPartial.cshtml so tried putting in that but not working need help anyone know what I did wrong been at it 4 days
Posted
Comments
Cristo Ferrao 16-Nov-21 5:52am     CRLF
Tried scaffolding in asp with angular on that it had worked react what issue, angular on that I was using latest visual studio 22 so react also tried but got little different Got InvalidOperationException: The default Identity UI layout requires a partial view '_LoginPartial' usually located at '/Pages/_LoginPartial' or at '/Views/Shared/_LoginPartial' to work. Based on your configuration we have looked at it in the following locations: /Areas/Identity/Pages/Account/_LoginPartial.cshtml /Areas/Identity/Pages/_LoginPartial.cshtml /Areas/Identity/Pages/Shared/_LoginPartial.cshtml /Areas/Identity/Views/Shared/_LoginPartial.cshtml /Pages/Shared/_LoginPartial.cshtml /Views/Shared/_LoginPartial.cshtml.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900