views:

76

answers:

1

How to get user roles from Membership provider?

Suppose I have a username and his/her password and now I need to retrieve his/her assigned Roles.

How can I do that?

+4  A: 

You want to call the Roles.GetRolesForUser method:

Gets a list of the roles that a user is in.

This method is overloaded and allows you to pass a username to retrieve all roles for a specific user.

Andrew Hare