Register new user using asp net core identity



Register new user using asp net core identity

Register new user using asp net core identity

How to register new user using asp.net core identity framework

Text version of the video
https://csharp-video-tutorials.blogspot.com/2019/06/register-new-user-using-aspnet-core.html

Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.
https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1

Slides
https://csharp-video-tutorials.blogspot.com/2019/06/register-new-user-using-aspnet-core_4.html

ASP.NET Core Text Articles & Slides
https://csharp-video-tutorials.blogspot.com/2019/01/aspnet-core-tutorial-for-beginners.html

ASP.NET Core Tutorial
https://www.youtube.com/playlist?list=PL6n9fhu94yhVkdrusLaQsfERmL_Jh4XmU

Angular, JavaScript, jQuery, Dot Net & SQL Playlists
https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd

To be able to register as a new user we need an email address and password.

RegisterViewModel Class

We will use this RegisterViewModel Class as the model for Register view. It carries the information from the view to the controller class. For validation we are using several asp.net core validation attributes. We discussed these validation attributes and model validation in detail in Parts 42 and 43 of this video series.

public class RegisterViewModel
{
[Required]
[EmailAddress]
public string Email { get; set; }

[Required]
[DataType(DataType.Password)]
public string Password { get; set; }

[DataType(DataType.Password)]
[Display(Name = “Confirm password”)]
[Compare(“Password”,
ErrorMessage = “Password and confirmation password do not match.”)]
public string ConfirmPassword { get; set; }
}

HttpGet Register action in AccountController

All the user account related CRUD operations will be in this AccountController.
At the moment we just have the Register action method
We reach this action method by issuing a GET request to /account/register

using Microsoft.AspNetCore.Mvc;

namespace EmployeeManagement.Controllers
{
public class AccountController : Controller
{
[HttpGet]
public IActionResult Register()
{
return View();
}
}
}

Register View

Place this view in Views/Account folder
The model for this view is RegisterViewModel which we created above

For the Register View HTML please refer to our blog at the following link
https://csharp-video-tutorials.blogspot.com/2019/06/register-new-user-using-aspnet-core.html

In our next video we will discuss
Implementing Register action that handles HttpPost to /account/register
Create a user account using the posted form data and asp.net core identity

Comments are closed.