How do you chcek what the username and role a user is a member of.

In vb 2005 When and How do you check what he username is and what role a user is a member of.
I have a login control on a form. When the login button is clicked I want to redirect to different pages depending on the role of the user.
whiwexAsked:
Who is Participating?
 
CmdoProg2Commented:
Opps, username is User.Name

you can also use the User.IsInRole("RoleA")

  to get all roles of an user .. Roles.GetRolesForUser ()
0
 
CmdoProg2Commented:
username is User.Identity.Name

To check for a particular role, such as RoleA use ...
Roles.IsUserInRole("RoleA")
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.