Link to home
Start Free TrialLog in
Avatar of Prysson
Prysson

asked on

How can I get the guid for an authenticated user?

How can I get the guid for an authenticated user?
Avatar of CJ_S
CJ_S
Flag of Netherlands image

Guid gUniqueId = (Guid)Membership.GetUser().ProviderUserKey;

provided that the MembershipProvider you are using actually HAS a Guid as a unique key. Some providers use a different method. If you really want to be sure that you can get the user, you should really use the username instead.

Cheers,
CJ.
Avatar of Prysson
Prysson

ASKER

How would I collect the username?
ASKER CERTIFIED SOLUTION
Avatar of CJ_S
CJ_S
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial