I'm having trouble understanding the new Identity stuff. I'm trying to figure out how to add new roles and add user's to those roles. I'm trying to create a role management page and a user management page for my application and need to be able to do those two things. Everytime i try to add a role to a user like this: System.Web.Security.Roles.AddUserToRole("Andy", "admin"); I get "The Role Manager feature has not been enabled." I don't have a custom role provider and i tried turning role manager to enabled but just got an error about not having a role provider. I figured Identity had all this built in already? Can somebody help me through this?
相关问题
- 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
System.Web.Security
is the old ASP.NET Membership framework. ASP.NET Identity is in the namespaceMicrosoft.AspNet.Identity
. Use aRoleManager
to create roles, and aUserManager
to add users to roles.