Example #1
0
    private void DisplayUsersBelongingToRole()
    {
        string selectedRoleName = RoleList.SelectedValue;

        string[] usersBelongingToRole = Roles.GetUsersInRole(selectedRoleName);

        RolesUserList.DataSource = usersBelongingToRole;
        RolesUserList.DataBind();
    }
Example #2
0
    private void DisplayUsersBelongingToRole()
    {
        // Get the selected role
        string selectedRoleName = RoleList.SelectedValue;

        // Get the list of usernames that belong to the role
        string[] usersBelongingToRole = Roles.GetUsersInRole(selectedRoleName);

        // Bind the list of users to the GridView
        RolesUserList.DataSource = usersBelongingToRole;
        RolesUserList.DataBind();
    }
Example #3
0
        private void DisplayUsersBelongingToRole()
        {
            // Get the selected role
            string selectedRoleName = RoleList.SelectedValue;

            // Get the list of usernames that belong to the role
            string[] usersBelongingToRole = RoleManager.FindByName(selectedRoleName).Users.Select(u => UserManager.FindById(u.UserId).UserName).ToArray();

            // Bind the list of users to the GridView
            RolesUserList.DataSource = usersBelongingToRole;
            RolesUserList.DataBind();
        }