I am using the following code below to populate users roles. In my case a user can have multiple roles; utilizing the code below it only selects the first role (alphabetically) and stops after that. Can someone tell me how to get it to run through all of the possible roles so that I know all of the users roles that he/she is assigned to?
Private Sub CheckRolesForSelectedUser()
' Determine what roles the selected user belongs to
Dim selectedUserName As String = UserList.SelectedValue
Dim selectedUsersRoles() As String = Roles.GetRolesForUser(selectedUserName)
' Loop through the Repeater's Items and check or uncheck the checkbox as needed
For Each ri As RepeaterItem In UsersRoleList.Items
' Programmatically reference the CheckBox
Dim RoleCheckBox As CheckBox = CType(ri.FindControl("RoleCheckBox"), CheckBox)
' See if RoleCheckBox.Text is in selectedUsersRoles
If Array.IndexOf(Of String)(selectedUsersRo ...
Go to the complete details ...