Register new user using asp net core identity

preview_player
Показать описание

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
Рекомендации по теме
Комментарии
Автор

I lead a team of engineers at MS and I love these videos. Brilliant.

brunoterkaly
Автор

you are a legend vekat Microsoft have to support you I didn't know how to mention them If any one knows please tell me

MmMm-tgmq
Автор

hello! could you tell me How to extend properties for the user class created with user manager?

wymowaiyan
Автор

Is there a way to add bulk data to Identity service database? Not using the services/UI to add one by one, this is required when hundreds of users required to access the page with right roles

explorewithdeepdivya
Автор

Hello Venkat. I am building an application with angular + netcore api(using Identity EF). angular allow user login with FB, Google using firebase...after successfully login, client send user info to api to create user behind the scenes.


Could you please let me know if that is good aproach. If so, could you please show me how Identity handle external login?
Thanks!.

johnnguyen
Автор

I am the person who gave 1000th like on this channel😂😂😁😁😁😁

gammingbuddy
Автор

Did We use Database to save username and password???

dhudibhai
Автор

Why did we use ViewModel and not just models?

lifetraveler
Автор

is it possible to generate account controller/view models and other identity things automatically like in asp.net ?

yavuzsylu
Автор

Did someone had an issue with the @model RegisterViewModel ?


Error CS0246 The type or namespace name 'RegisterViewModel' could not be found (are you missing a using directive or an assembly reference?)

vityamv
Автор

Good Information !!! What is the difference between doing it this way and using Identity Entity Framework Model?

trustingod
Автор

why when you hit the register button, the validation didn't work, It should validate required field, am I true???

IMateme
Автор

Make sure you wrap Register page inside a container class to have all properties line up with navbar.

jaydanvarnell
Автор

For Register right alignment use ms-auto

TS-swvg
Автор

the title says register new user using as net core but it show mostly html... maybe you need to review youre titles, they look like clickbaits...

nicolaserriquenz
Автор

my dude, show your freaking services. you do too much copy/paste and forget to show half of the required stuff . that is the reason 90% of the comments have issues. in all of your videos

TheMashmeister
Автор

Why did we use ViewModel and not just models?

TheKuttaapi