Part 16 - Custom Login Dialog (Identity) - Let's Build an ASP.NET Core MVC Web Application on .NET 5

preview_player
Показать описание
In this video we write the code to create a custom login facility. The login facility will be presented to the user as a modal dialog. The user can enter credentials into a form contained with the modal dialog, and then submit the entered data to the relevant server side code responsible for logging the user into the system or rejecting the suers login attempt. The relevant data will be submitted to the server side code asynchronously, and if the users login fails, the login form is updated with feedback from the server with the reason why the users login attempt failed. This will provide the user the a convenient way to make another attempt at logging onto the system. In this case, only the login modal dialog is refreshed (asynchronously) on the webpage, which means there is no need to refresh the entire browser window. This provides better performance.

(3:02) - Identity UI Template Files
(10:35) - Custom Login Dialog - Introduction
(12:54) - Stage 1 - Let's Create the '_UserLoginPartial' Partial View
(16:03) - Stage 2 - Let's Update the Login Menu
(17:32) - Stage 3 - Let's Create the 'LoginModel' Class
(19:44) - Stage 4 - Let's Create the Login Form
(24:52) - Stage 5 - Let's Create the 'UserAuthController' Controller Class
(38:03) - Stage 6 - Let's Write the jQuery and AJAX Client-side Code

Links
---------
If you’d like to help support the channel,

Buy me a Coffee ☕️

PayPal

BitCoin
12JZYMiRq5YRDN5R5zuyYt7jMN8eTpkgns

Bootstrap 4 Modal Dialog Template Code

Copy Code from GitHub
--------------------------------------
_UserLoginPartial Partial View

UserAuthController Controller Class

jQuery Code

----
Full playlist - Let's Build an ASP .NET Core MVC Web Application on .Net 5

Migration (add the admin account) Code on GitHub

C# Asynchronous Programming Video Series

GUID Generator

Attributes

Part 1

Part 3

Part 13

Part 14

Part 15

Full playlist - C# for Beginners Course

Full playlist - Advanced C# Course

Additional Information
------------------------------------
Bootstrap 4 Forms

Unobtrusive Validation

BootStrap 4 Grid

Anti-forgery token - Prevent Cross Site Request Forgeries

GitHub
-----------
Latest Code

PDF Document - Database Design

All music in this video was created by Gavin Lon
Рекомендации по теме
Комментарии
Автор

I am not c# dev, and I am enjoying and understanding every bit you said. ASP community is lucky for this quality and content!

omarelkhatib
Автор

There was a lot to digest this time around. Thanks for the thorough explanations. Much appreciated.

pbgrafx
Автор

Thank you very much for useful coding tutorial from your time and effort. Really appreciate for your elaborated explanations.

ckone-mindlearn
Автор

Thank you for your time and efforts. Eternally grateful for your contributions 🙏

VinuP
Автор

Your content is a godsent 🙏





Also I fixed the previously mentioned issue and deleted the comment before I saw you actually replied, sorry about that ! :D

videlin
Автор

first thanks for efforts and time It's really amazing, would you complete this playlist for user Category ?

ayaosama
Автор

Hello, I have a problem with the login modal. I have carefully followed all 6 steps, but when I click Login, the modal does not disappear, however if I reload the page, the user is logged in. Do you know why this is happening? I can provide more info if necessary.

Thank you !

David-qujz
Автор

If i want to create an action and i want the user to be logged in, how do i make the modal pop-up instead of the identity login view page ?

joaogusmao
Автор

Hey Gavin, really enjoying your course so far. Upon creating the LoginModel, I wondered why we did not include the Entities folder or its content within Model folder? Is my notion that the entities themselves are also models, incorrect? Thanks!

joshuacorpuz
Автор

14:00 As of 2022, the Bootstrap Modal 4.0 is not viable for this; use a newer version. Anyways, great tutorial!

catayasericjay
Автор

this is really very appreciable thank you, but i have a problem on getting the popup alert after clicking login?, i have also put the link of js into the index but the login button is not responding still?

meronabate
Автор

hi gavin thank you for the videos they are great
i have a question : is it better to seperate the database logic from the main project into a class library ? i see people do that some times and i was wandering is it worth it ?

legion
Автор

???? 8:10 What happend here ? How do you move forward from here ? Please someone help !

KonstantinChikov
Автор

Thanks for the videos. Great and wonderful work.
I am having some errors..
LoginModel.LoginInvalid= "true"...cannot implicitly convert type string to bool.
Please help

godsentchizzy
Автор

How do I make it work on every page, like not just from the but lets say I want to login while viewing the page "Home/Privacy" ?
I got the modal showing on every page, but when i try to login I always get the "Error! Status: 404".

videlin
Автор

Can you do regular user login id not email address as user id

rogercute
visit shbcf.ru