Author: Bobby-Z | Posted on: 12/22/2009 10:38:05 PM | Views : 916

 I have 2 problems with roles
1. I cannot display the role a current user is in using a label control
my code is   RoleLabel.Text = Convert.ToString(Roles.GetRolesForUser(UserID));
the error I get is : Cannot Implicitly convert type []string to string
 
2. I have codebehind using IsUserInRole to route to the proper method to use depending upon the user
if (roles.IsUserInRole(UserID, "Customer")
{Get_Customer_Info();}
if (roles.IsUserInRole(UserID, "Employee")
{Get_Employee_Info();}
 The information does not display on the page, but when I delete the if statements (or switch no matter) it works, but if an employee is logged in or customer is logged in I have to read all info just to make sure it gets displayed, when what I want to do is only read and display info needed (customer or employee)
Now each person is only in one role, not multiple roles. ...

Go to the complete details ...