How do I get access to the User.Identity.Name in the codebehind mo

G

Guest

Hello:

Can somebody tell me how I can code the Page_Load event to set the Text
property of a label to reflect the User.Identity.Name?

Thanks.

venki
 
M

Mythran

vvenk said:
Hello:

Can somebody tell me how I can code the Page_Load event to set the Text
property of a label to reflect the User.Identity.Name?

Thanks.

venki

It depends when the User.Identity.Name property is set (assuming the User =
HttpContext.Current.User). If you are setting it yourself at a later time
and it is empty (or an unexpected value) at Page_Load, then you are setting
it too late :)

HTH,
Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top