0

I have created a blank template MVC project with user accounts in Visual Studio 2019, i.e. ASP.NET Core Web Application -> Web Application (Model View Controller), Authentication = Individual user accounts.

When you run the project, you can navigate to the pages for /Identity/Account/Register and /Identity/Account/Login. However, I can't see any reference to these pages in the project structure.

The Areas/Identity folder does not contain any controllers or views, and I can't see any custom routing which redirect Identity/Account/Register to a different controller action.

Where is the html for these pages generated?

RiddleMeThis
  • 851
  • 1
  • 8
  • 18

2 Answers2

0

If you create the application by selecting "MVC" option, the account controller is scaffolded for you. But if you select "Web Application", Razor page application will be created and all the views related to identity section will be loaded from a Razor Class Library (Microsoft.AspNetCore.Identity.UI).

You can still customize and use you custom view pages for Identity section.

rabink
  • 679
  • 8
  • 13
  • I selected the MVC option, and it didn't scaffold the account controller. It scaffolds the home controller, but the account section is done out the box using the Razor Class Library. – RiddleMeThis Jun 17 '20 at 21:10
0

To view the detailed code related to identity, you can right-click the current project, select Add->New Scaffolded Item, and then select the Identity module.

In the pop-up Add Identity box, you can select all the pages you need to override, and then Select the corresponding Context in the Data context class dropdown.

enter image description here

Finally click add, you will see the corresponding page code under Areas/Identity/Pages/Account.

enter image description here

More details, you can see this thread.

LouraQ
  • 6,443
  • 2
  • 6
  • 16