• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

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.
0
whiwex
Asked:
whiwex
  • 2
1 Solution
 
CmdoProg2Commented:
username is User.Identity.Name

To check for a particular role, such as RoleA use ...
Roles.IsUserInRole("RoleA")
0
 
CmdoProg2Commented:
Opps, username is User.Name

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

  to get all roles of an user .. Roles.GetRolesForUser ()
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now