Just in case someone comes with the same question. To manipulate the users without binding them to any component it is quite simple:
First the controller, we get all the users:
public class UserController : Controller
{
//
// GET: /Admin/User/
public ActionResult Index()
{
return View(Membership.GetAllUsers());
}
}
Be carefull in case you have too many users this can become a performance issue, I mean to retrieve all in one go without filtering or pagination.
Then in the view just interate through the collection, and for each user just the the roles and interate through them as well:
@model MembershipUserCollection
@{
ViewBag.Title = "Index";
}
@foreach (MembershipUser user in Model)
{
var roles = Roles.GetRolesForUser(user.UserName);
<p>
@user.UserName
<br />
@foreach (var role in roles)
{
<span>@role</span>,
}
</p>
}