Search code examples
c#asp.netasp.net-core-mvcrazor-pages

Modified and redesign login page html in ASP.NET Core 3.1 MVC


I am building an ASP.NET Core MVC web app targeting .NET Core 3.1.

I've enabled authentication type "Individual Accounts" and that created login and register pages.

When I run the project, I can see the link of my login page was

https://localhost:44344/Identity/Account/Login

but I can not find html login page in that path

Identity/Account/Login

Also I do search in my repo folder where my project is exists, still can't find it. There is nothing in my solution project ... there is only _LoginPartial.cshtml

here is my solution explorer

So where is this file stored?

And if it does not exist or is created dynamically in some way, how can I redesign the login or register html pages?


Solution

  • You’ll have to scaffold those pages. I wrote a blog on it.

    https://kevinritchie.co.uk/blazor/server/identity/2021/03/25/override-login-page-blazor-server-app.html

    Essentially, you need to right click on your project and click Add. Then select Add Scaffolded Item.

    From the Add New Scaffolded Item window, select Identity.

    You’ll get a few options to pick from. You’ll need to select Account/Login and Account/Register.