繁体   English   中英

ASP.NET Identity用户名中的特殊语言字符

[英]Special language characters in username of ASP.NET Identity

我想在用户名中使用一些特殊字符,例如ø

但我正面临着这个错误

IdentityResult result = UserManager.Create(applicationUser, password);

错误:

用户名testø无效,只能包含字母或数字。

我们如何解决它? 如何允许一些特殊字符?

我发现我该怎么办

 public class ApplicationUserManager : UserManager<ApplicationUser>
    {
        public ApplicationUserManager()
            : base(new UserStore<ApplicationUser>(new ApplicationDbContext()))
        {
            PasswordValidator = new MinimumLengthValidator(4);
            UserValidator = new UserValidator<ApplicationUser>(this)
            { AllowOnlyAlphanumericUserNames = false  }; 
        }
    }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM