C# code for identify log in user of a website and how to display log in username in a label
Identify login username using c# code
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ramasagar PulidindiRank #163 · 14.4K reputationPosted Jan 22, 2014, 6:00 AM EST
u can use Session.... just make sure that session is valid ... so that it would not raise when session is timed out or invalid
if(Session["UserId"] != null) {
Label1.Text = Session["Userid"].ToString();
}