Security Server Controls

Discussion in 'ASP .Net' started by n I c H o L a S, Jun 11, 2008.

  1. I am using the Login, LoginName, LoginStatus and LoginView controls in
    my ASP.NET 2.0 website. I need to be able to control user access at a
    more fine grained level in my C# code but I can not figure out how to
    get the username of the current logged in user. None of the above
    controls seem to expose the username as a property. Am I missing
    something here is there a special way to get the username?
     
    n I c H o L a S, Jun 11, 2008
    #1
    1. Advertising

  2. n I c H o L a S

    subtile Guest

    The Login Control has a UserName property..

    You can also retrieve it by code after login

    User.Identity.Name;

    --

    Jesus Loves You


    "n I c H o L a S" wrote:

    > I am using the Login, LoginName, LoginStatus and LoginView controls in
    > my ASP.NET 2.0 website. I need to be able to control user access at a
    > more fine grained level in my C# code but I can not figure out how to
    > get the username of the current logged in user. None of the above
    > controls seem to expose the username as a property. Am I missing
    > something here is there a special way to get the username?
    >
     
    subtile, Jun 11, 2008
    #2
    1. Advertising

  3. Thanks
     
    n I c H o L a S, Jun 11, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c2lhag==?=
    Replies:
    7
    Views:
    1,513
    =?Utf-8?B?c2lhag==?=
    Mar 7, 2005
  2. Aaron
    Replies:
    1
    Views:
    369
    John C. Bollinger
    Aug 4, 2003
  3. Marco
    Replies:
    1
    Views:
    2,437
    Roedy Green
    Jan 28, 2006
  4. Nathan Sokalski
    Replies:
    4
    Views:
    1,154
    Muhammad Naveed Yaseen
    Sep 5, 2007
  5. brian

    HTML Server Controls vs Web Server Controls

    brian, Jan 21, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    316
    Steve C. Orr [MVP, MCSD]
    Jan 24, 2005
Loading...

Share This Page