简体   繁体   English

拥有Web表单时如何向asp.net添加角色

[英]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窗体应用程序来查看它。

在此处输入图片说明

在此处输入图片说明

More Resources for Identity in WebForm WebForm中用于身份的更多资源

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

相关问题 SimpleMembership WebForms Asp.net 4.0角色 - SimpleMembership WebForms Asp.net 4.0 roles 如何为 ASP.NET WebForms、MVC 和 CORE 拥有一个通用的 HttpContext - How to have a common HttpContext for ASP.NET WebForms, MVC and CORE 使用背后的代码在asp.net网络表单中的角色和用户管理 - Roles and User management in asp.net webforms using code behind 如何在ASP.NET Web表单中动态添加数据条目表单 - How to dynamically add a dataentry form in asp.net webforms 如何实现授权在与不同的用户角色不同的访问权限asp.net Web表单 - How to implement Authorization in asp.net Webforms with different access rights with different user roles 如何在Asp.net Core中注册时添加用户角色 - How to add user roles upon registrations in Asp.net Core 如何将自定义角色添加到ASP.NET Core - How to add custom roles to ASP.NET Core 如何在ASP.NET Core中将角色添加到Windows身份验证 - How to add Roles to Windows Authentication in ASP.NET Core 单击后如何禁用ASP.NET WebForms按钮,并在回发完成后再次启用它? - How would one disable an ASP.NET WebForms button when its clicked, and have it be enabled again after postback completes? 如何在asp.net webforms中使用HttpClient - How to use HttpClient in asp.net webforms
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM