How do I set the AllowOnlyAlphanumericUserNames flag on Microsoft.AspNet.Identity.UserManager so that UserValidator will allow non-alphanumeric UserName?
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to store image outside of the website's ro
- 'System.Threading.ThreadAbortException' in
- Custom controls disabled. There was an internal is
- Request.PathInfo issues and XSS attacks
相关文章
- asp.net HiddenField控件扩展问题
- asp.net HiddenField控件扩展问题
- Asp.Net网站无法写入错误日志,测试站点可以,正是站点不行
- asp.net mvc 重定向到vue hash字符串丢失
- FormsAuthenticationTicket expires too soon
- “Dynamic operations can only be performed in homog
- What is the best way to create a lock from a web a
- Add to htmlAttributes for custom ActionLink helper
As of ASP.NET Identity 3.0 (currently in RC), this is now configured as an option on the user.
}
Same code as a Gist: https://gist.github.com/pollax/4449ce7cf47bde6b3a95
You can write your own UserValidator like this. And then use it:
In UserManager contructor:
another way of doing
Yet another way of doing it:
John's answer is right, I used his answer to allow email as username (Wasn't working by default)
Please upvote/accept John's answer.
Here is some code where I used a custom UserManager" to get things working
(This way there's less repeating elsewhere too)
And here's what the AccountController Constructor code looks like now: