Where are the Login and Register pages in an AspNet Core scaffolded app?

In VS 2017, I created a new ASP.NET Core Web Application. On the second page of the wizard, I chose Web Application, and for Authentication, I chose “Individual User Accounts”.

Now, I’m trying to find the Pages associated with /Account/Register and /Account/Login.

_Layout.cshtml brings in _LoginPartial.cshtml, much as it did in classic MVC:

<div class="navbar-collapse collapse">
    <ul class="nav navbar-nav">
        <li><a asp-page="/Index">Home</a></li>
        <li><a asp-page="/About">About</a></li>
        <li><a asp-page="/Contact">Contact</a></li>
    </ul>
    <partial name="_LoginPartial" />
</div>

If the user is not signed in then _LoginPartial includes <a> tags that point to the login and register pages:

<ul class="nav navbar-nav navbar-right">
    <li><a asp-area="Identity" asp-page="/Account/Register">Register</a></li>
    <li><a asp-area="Identity" asp-page="/Account/Login">Login</a></li>
</ul>

That all seems to make sense. But I would have expected the Areas folder structure to include the Register and Login folders. It does not. The only thing I find there is _ViewStart.cshtml

Areas file structure

I know that the scaffolded code works. When I run the project, the Register link points to “/Identity/Account/Register”, and the Login link points to “/Identity/Account/Login”. Clicking on the Register link gets me a registration page that includes the text “Create a new account”.

But I can’t find the text “Create a new account” anywhere in the project.

Can someone tell me what I’m missing?

6 Answers
6

Leave a Comment