By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,997 Members | 1,260 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,997 IT Pros & Developers. It's quick & easy.

Getting the user name

P: n/a
I have upgraded a Web application from Visual Studio 2003 to 2008. A line of
code that was working now returns an empty string:

UserName = System.Web.HttpContext.Current.User.Identity.Name

The application was running under .NET 1.1 and is now .NET 2.0

Can anyone tell me what the code should be to read the user's login name?

Thank you,
Helen

Oct 2 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sorry, please ignore this. I had Anonymous Access set to on for the new web
site. I turned it off and it is working now.

Doh!

"Helen Trim" wrote:
I have upgraded a Web application from Visual Studio 2003 to 2008. A line of
code that was working now returns an empty string:

UserName = System.Web.HttpContext.Current.User.Identity.Name

The application was running under .NET 1.1 and is now .NET 2.0

Can anyone tell me what the code should be to read the user's login name?

Thank you,
Helen
Oct 2 '08 #2

P: n/a
On Oct 2, 7:07*am, Helen Trim <HelenT...@discussions.microsoft.com>
wrote:
Sorry, please ignore this. *I had Anonymous Access set to on for the new web
site. *I turned it off and it is working now.

Doh!

"Helen Trim" wrote:
I have upgraded a Web application from Visual Studio 2003 to 2008. *Aline of
code that was working now returns an empty string:
* * * * * * UserName = System.Web.HttpContext.Current.User.Identity.Name
The application was running under .NET 1.1 and is now .NET 2.0
Can anyone tell me what the code should be to read the user's login name?
Thank you,
Helen
Well, you get partial credit for finding the problem before I got my
message finished.

:-)

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Oct 2 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.