Getting the user name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SGVsZW4gVHJpbQ==?=

    Getting the user name

    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.Http Context.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

  • =?Utf-8?B?SGVsZW4gVHJpbQ==?=

    #2
    RE: Getting the user name

    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.Http Context.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
    >

    Comment

    • rowe_newsgroups

      #3
      Re: Getting the user name

      On Oct 2, 7:07 am, Helen Trim <HelenT...@disc ussions.microso ft.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.Http Context.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]

      Comment

      Working...