I am developing a .NET core application with Identity login which provides a Bootstrap form In the /Identity/Account/Login page.
I have imported Materialize CSS files in the wwwroot/lib folder and want to change the Login page's design with materialize css as well.
The problem is /Identity/Account/Login page doesn't exist in project structure. Then how should I approach to solve this problem?
From Asp.net Core 2.1, Identity UI code are not included in project structure.
You can see this line of code in StartUp file -> method ConfigureServices
If you want to customize the UI, you have to generate this bunch of code by 2 ways:
1. Using Visual Studio: right click at project -> add -> new scafolded item -> identity -> and choose which you want to be generate.
2. Using CLI: from the project directory run this command-line
One way would be to scaffold the login page, which would add it to your project structure. Then you would be able to make any changes you want. You would have to do the following (from the link I provided):
Another way would be to look at the Login page source code and see HTML elements' ids and classes. Then you could override the default CSS by writing your own CSS that would be more specific than the default one.
The default
Identity
pages you see are generated behind the scenes from this dll in your project:Microsoft.AspNetCore.Identity.UI.Views.V3.dll
-- located here --
Dependencies >> SDK >> Microsoft.AspNetCore.App(2.2.0)
.Follow
@Marko Papic
step by step instructions to generate theIdentity
pages (or partials) you'd like to override with your Material css. Within these (now view-able pages) is all the logic and naming references to theIdentity
classes, methods, properties etc you'll need to build your own custom page.Additionally, you don't need to stick to the default
Areas/Identity/Pages/Account...
file location or razor syntax. You could, if you wanted to, create your ownMVC
versions, orvue.js
in whatever file structure/representation you like.I keep a project off to the side that has overridden all of the
Identity UI
pages ( checkboxOverride all files
that serves as a handy reference where I can bring over what I need as I need it.@Marko Papic
has provided a nice answer for you, I'l suggesst you select his answer as the correct one..