How do i get all users from a specific role?
var users = Membership.GetAllUsers();
gets all users in all roles.
it returns a list of MembershipUser, but there is no role property.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to use the Roles class defined in System.Web.Security. It has a
Roles.GetUsersInRolemethod.Here is the documentation.
If you want to map the returned username to a
MembershipUseryou can use Membership.GetUser(string username) method on each of the returned values.