ASP.NET identity use email instead of user name
asp.net-identity, asp.net-mvc-5, c#
Solution
You have 2 options to solve it by either turning off that validator, or create your own UserValidator.
You could turn it off like this:
UserManager.UserValidator = new UserValidator<TUser>(UserManager)
{
AllowOnlyAlphanumericUserNames = false
};
Problem
How can I use email instead of user name in the new ASP.NET identity system? I tried to change the `RegisterViewModel` class: ``` [Display(Name = "Email address")] [Required(ErrorMessage = "The email address is required")] [EmailAddress(ErrorMessage = "Invalid Email Address")] public string UserName { get; set; } ``` but when I enter an mail adress I am getting the error: ``` User name fsdfsd@fsdfsd.de is invalid, can only contain letters or digits. ```