Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where to get the loged in user ID
Message
 
 
À
04/07/2010 13:24:42
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 4.0
Divers
Thread ID:
01471353
Message ID:
01471362
Vues:
39
>>>Sorry for about that. I am using the built in Membership controls. It works quite well except I need to get the user ID that is stored in the aspnet_Membership table. I found the user name in Page.User.Identity.Name. I really don't want to make another trip to the database just to get the userid.
>>>
>>Found this http://www.andreas-kraus.net/blog/aspnet-membership-get-the-userid-of-the-user/
>>
>>I've searched through my own web pages but didn't find anything relevant in pages I scanned through. I think the above is how we accessed it, but don't recall details exactly.
>
>That's exactly the same as my suggestion anyway.....

I thought it was different... But may be it is the same. E.g. Membership.GetUser(); // Does it require a trip to database?

Update. Re-read your suggestion again - yes, it's the same.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform