filmov
tv
Register new user using asp net core identity
Показать описание
Text version of the video
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.
Slides
ASP.NET Core Text Articles & Slides
ASP.NET Core Tutorial
Angular, JavaScript, jQuery, Dot Net & SQL Playlists
To be able to register as a new user we need an email address and password.
RegisterViewModel Class
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
In our next video we will discuss
Implementing Register action that handles HttpPost to /account/register
Комментарии