How can I get userID and roleID of user that is logged to application? User.Identity
doesn't contain these details?
Thanks,
Ile
How can I get userID and roleID of user that is logged to application? User.Identity
doesn't contain these details?
Thanks,
Ile
Here's how:
string userId = Membership.GetUser().ProviderUserKey.ToString();
string[] roleNames = Roles.GetRolesForUser(username);
Another good one to know is:
bool isAdmin = Roles.IsUserInRole("Admin");