Where is the Register and Login controllers/views in asp.net core MVC

Gerald Humphreys 20 Reputation points
2024-08-27T09:41:06.5233333+00:00

When i create a new asp.net core(MVC) app and select individual accounts and click create.

I can see the login and register links which is under _LoginPartial.cshtml

I cannot find any controllers to do with the accounts. If i run this app and i click on register. It takes me to /accounts/register link which is there but i cannot see this in my solution explorer

Developer technologies | ASP.NET | ASP.NET Core
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AgaveJoe 30,126 Reputation points
    2024-08-27T09:46:20.8966667+00:00

    The login logic is in a Razor Class Library. If you want to review or change the code then you can scaffold the Identity pages.

    2 people found this answer helpful.
    0 comments No comments

  2. SurferOnWww 4,721 Reputation points
    2024-08-28T00:42:10.6466667+00:00

    I suggest that you follow the instructions described in the "Scaffold Identity into an MVC project without existing authorization" section in the following Microsoft document to include the source code of login, register and others for the ASP.NET Core Identity in your MVC project:

    Scaffold Identity in ASP.NET Core projects

    The Razor pages of the login, register and others for the ASP.NET Core Identity will be generated under the Areas > Identity > Pages > Account folder as shown below:

    enter image description here

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.