开发者

how to Assign roles to User while creating their account

开发者 https://www.devze.com 2023-01-08 16:17 出处:网络
i am using asp.net built-in membership an开发者_如何学运维d role provider. In my application Admin Create account for user.

i am using asp.net built-in membership an开发者_如何学运维d role provider.

In my application Admin Create account for user.

currently i am assigning roles by going to asp.net configuration website.

kindly tell me how to add an extra step of Select Role in creat user account API.

Thanks.


Are you just asking how to assign a User to a Role?

Roles.AddUserToRole(userName, roleName);

And to remove a role:

Roles.RemoveUserFromRole(userName, roleName);


Please refer to : http://www.asp.net/security/tutorials/assigning-roles-to-users-cs

0

精彩评论

暂无评论...
验证码 换一张
取 消