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

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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

Back
Top