简体   繁体   中英

Login name on website in asp.net c# on label

I have searched on different sites how to get login name on label in asp.net using c# but i can't find the exact answer.There is login control .i don't want to use that .I just want to display a login name on a label when user log in.Can any one help me please in this issue. i will be really thankful to you

The username will be stored in User.Identity.Name . Assuming you have a Label with an ID of Lbl1 on your page...

Lbl1.Text=User.Identity.Name;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM