asp.net membership - how to determine programmatically is user is in role

前端 未结 4 1912
礼貌的吻别
礼貌的吻别 2020-12-19 00:02

What is the code for determining if a user is in a role?

I have set up all the users through the ASP.NET Configuration Security tab but now want to put logic around

4条回答
  •  春和景丽
    2020-12-19 00:39

    Check out the Roles class, specifically IsUserInRole, GetUsersInRole, AddUserToRole, etc.

    I use these all the time.

提交回复
热议问题