Question: I need to get the userId of the logged in user in ASP.net, I can use 

```
System.Web.HttpContext.Current.User.Identity.Name

```

to get the name, but how do I get the userID?

I tried (GUID) and Membership.GetUser as I found, but none seem to work.

Answer: 
Check the [ProviderUserKey](http://msdn.microsoft.com/en-us/library/system.web.security.membershipuser.provideruserkey.aspx) property.
`Dim mu As System.Web.Security.MembershipUser = System.Web.Security.Membership.GetUser()`

`Dim strUsrId As String = mu.ProviderUserKey.ToString()`

Hope this helps.