0

How do I get the ID from the currently authenticated user in asp.net mvc

I asked this before How to tie SqlRoleProvider to "My" user table

And so now I am using this method to save the GUID from a new user into my table.

Guid id = MembershipService.GetUserID

So then I have that guid in my table as well as the built in authentication stuff. What I need to do now is when someone gets authenticated is to get the ID as a guid of the currently logged in user.

Is this possible and if so how?

If there is an easier way please let me know.

Thanks

Community
  • 1
  • 1
Maestro1024
  • 3,173
  • 8
  • 35
  • 52

1 Answers1

1

You might want to look at some of the other answers on the site:

Your favorite "current user"-pattern for Asp.net applications?

Should I use the username, or the user's ID to reference authenticated users in ASP.NET

Getting the GUID of the current user?

Community
  • 1
  • 1
rboarman
  • 8,248
  • 8
  • 57
  • 87