Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving a user's role and viewing it

Status
Not open for further replies.

andy2325

Programmer
Jul 2, 2007
13
US
I was wondering how I can go about viewing a user's role using the membership provider. I have tried the following:

dim strRoles() as string
strRoles = Roles.GetRolesForUser("User")
lblRole.text = strRoles
 
So what happens when you run your code. I suspect you get an error, or some weird text because you are trying to assign an array to a label. You will have to loop through the array of strings and display them. Also, verify what GetRowsForUsers returns.
 
I get an error saying that it can not convert value of type '1-dimensional array of string' to 'string'
 
Yes exactly what I said. You have to loop through the values in the array.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top