Display user name
I have used login control in login.aspx and I want that when user logged in only user name display rest of the pages.
2 Answers
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
Sandeep ShekhawatRank #2,439 · 577 reputationPosted Jun 8, 2011, 9:49 PM EDT
Use this at Login Button Click Event
Session["username"]=Login1.UserName;//Login1 is Login control ID
another page it display in page use label control
use at Page_Load Method
Label1.Text=Session["username"] //Label1 is Label control ID
Gomathi PalaniswamyRank #714 · 3.3K reputationPosted Jun 8, 2011, 9:49 PM EDT
you can achive this by session and query string.
protected void Page_Load(object sender, EventArgs e)
{
Login1.FormatString ="sss";
}
use the login1 ..
use the below link for some other methods
http://forums.asp.net/t/1367379.aspx/1?Display+user+name+in+the+header+when+logged+in