how to use Roles.GetUsersInRole by selecting roles from checkbox list
Posted on 2009-04-14
I have app using standard roles and membership. I have checkbox that is populated with all roles like this
checkbox1.DataSource = Roles.GetAllRoles();
I want to check a number of roles on the checkbox and if the role is selected then add all usernames to a list. Something like
foreach (ListItem theseRoles in checkbox.Items)
//then add all the usernames to the list
listofUserNames = new List<string>(Roles.GetUsersInRole(checkbox.text));
//and so on adding all the usernames to the list for each checkbox role checked.
How can I implement this?