I'm using the default ASP.NET profile and membership provider. I want to create a ASP List View with the name of the user and their role. When I try using this functionality I get a error:
Code behind:
public List<aspnet_Users> GetUsers(int startRowIndex, int maximumRows)
{
this.entities.aspnet_Users.Include("aspnet_Roles").OrderBy(u => u.UserId).Skip(startRowIndex).Take(maximumRows).ToList();
}
Page directive:
<%# Eval("aspnet_Roles.RoleName")%>
It's not working because it's a many to many relationship in the database. How do I change my code behind method to map across the many to many relationship?