Laziale
Laziale

Reputation: 8225

getting role from the user logged in returns no data

I am trying to get the role of the user which just logged in the website. I am doing this:

string userRole = Roles.GetRolesForUser(LoginUser.UserName).ToString();

but that returns 'System.String', not the real role :(. What am I doing wrong? Thanks

P.S. LoginUser is the login control

Upvotes: 0

Views: 612

Answers (1)

Jahan Zinedine
Jahan Zinedine

Reputation: 14874

string[] roles = RoleProvider.GetRolesForUser(LoginUser.UserName);

http://msdn.microsoft.com/en-us/library/ff647401.aspx

Upvotes: 1

Related Questions