[英]how to add roles to asp.net when you have webforms
I am beginner in ASP.NET, and I need help to create user roles and identity. 我是ASP.NET的初学者,我需要帮助来创建用户角色和身份。 Until now, I have create few Webforms (Registration page, Login page...) but I don't know how to manage user roles. 到目前为止,我只创建了几个Webforms(“注册”页面,“登录”页面...),但是我不知道如何管理用户角色。 I want to bind users with roles, and identities. 我想用角色和身份来绑定用户。 I saw few examples how to do it, but it didn't work for me. 我没有看到一些如何执行此操作的示例,但是它对我没有用。 Thank you in advance for help. 预先感谢您的帮助。
I have just tried to enable asp.net configuration option in VS 2013 (as it is described here http://alireza-afshar.com/wordpress/?p=74 ) but I got error message: 我刚刚尝试在VS 2013中启用asp.net配置选项(如此处所述http://alireza-afshar.com/wordpress/?p=74 ),但出现错误消息:
There is a problem with your selected data store. 您选择的数据存储有问题。 This can be caused by an invalid server name or credentials, or by insufficient permission. 这可能是由于无效的服务器名称或凭据或权限不足引起的。 It can also be caused by the role manager feature not being enabled. 也可能是由于未启用角色管理器功能引起的。 Click the button below to be redirected to a page where you can choose a new data store. 单击下面的按钮将重定向到页面,您可以在其中选择新的数据存储。 The following message may help in diagnosing the problem: Access to the path 'C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Temporary ASP.NET Files\\root\\0d4c4367\\763dc453\\hash' is denied. 以下消息可能有助于诊断问题:拒绝访问路径“ C:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ Temporary ASP.NET Files \\ root \\ 0d4c4367 \\ 763dc453 \\ hash”。
Could please someone help me with this? 可以请人帮我吗? Thank you in advance. 先感谢您。
ASP.Net comes with Membership Provider since .Net 2.0, so you do not have to reinvent the wheel. 自.Net 2.0以来,ASP.Net附带有Membership Provider,因此您不必重新发明轮子。
The latest version is called ASP.NET Identity . 最新版本称为ASP.NET Identity 。 You can look at it by creating a new Web Forms application. 您可以通过创建一个新的Web窗体应用程序来查看它。
还要检查Aspnet_regsql.exe工具,该文章将对您有所帮助http://www.asp.net/web-forms/overview/older-versions-security/membership/creating-the-membership-schema-in-sql-服务器CS
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.