J
Jeff
ASP.NET 2.0
Below are some code from my webproject. What I'm trying to do is create a
MembershipUserCollection which holds users of the role "member"
this line:
string[] role = Roles.GetRolesForUser(user.UserName);
generates an array consisting of the roles belonging to the user. I'm a bit
stuck here. I need to quickly determine if this array have an item named
"member" within it... I know I can just create a simple for loop and loop
through the entire array but I hope there is some kind of direct access like
for example role["member"]...
MembershipUserCollection allUsers = Membership..GetAllUsers();
MembershipUserCollection members = new MembershipUserCollection();
foreach (MembershipUser user in allUsers)
{
string[] role = Roles.GetRolesForUser(user.UserName);
role.
}
any suggestions? Maybe you have a better way of getting the users belonging
to a role, then
please share it with me
Best Regards
Jeff
Below are some code from my webproject. What I'm trying to do is create a
MembershipUserCollection which holds users of the role "member"
this line:
string[] role = Roles.GetRolesForUser(user.UserName);
generates an array consisting of the roles belonging to the user. I'm a bit
stuck here. I need to quickly determine if this array have an item named
"member" within it... I know I can just create a simple for loop and loop
through the entire array but I hope there is some kind of direct access like
for example role["member"]...
MembershipUserCollection allUsers = Membership..GetAllUsers();
MembershipUserCollection members = new MembershipUserCollection();
foreach (MembershipUser user in allUsers)
{
string[] role = Roles.GetRolesForUser(user.UserName);
role.
}
any suggestions? Maybe you have a better way of getting the users belonging
to a role, then
please share it with me
Best Regards
Jeff