How to get the currently logged in user

Platform: ASP.NET| Category: Miscellaneous

To get the user ID of the user who is currently logged in, you would get it using this: System.Web.HttpContext.Current.User.Identity.Name

VB.NET


’Displays the currently logged in user
Response.Write(User.Identity.Name.ToString())

C#


//Displays the currently logged in user
Response.Write(User.Identity.Name.ToString());

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.