HttpContext.Current.User.Identity.Name AND Context.User.Identity.Name;

Discussion in 'ASP .Net' started by nalbayo, Nov 11, 2005.

  1. nalbayo

    nalbayo Guest

    what's the difference between

    HttpContext.Current.User.Identity.Name;
    and
    Context.User.Identity.Name;

    thanks!
    nalbayo, Nov 11, 2005
    #1
    1. Advertising

  2. None.

    One is used when coding inline; the other when coding in code-behind.



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    ASPNETFAQ.COM : http://www.aspnetfaq.com/
    Foros de ASP.NET en EspaƱol : http://asp.net.do/foros/
    ======================================
    "nalbayo" <> wrote in message
    news:...
    > what's the difference between
    >
    > HttpContext.Current.User.Identity.Name;
    > and
    > Context.User.Identity.Name;
    >
    > thanks!
    Juan T. Llibre, Nov 11, 2005
    #2
    1. Advertising

  3. nalbayo

    Bruce Barker Guest

    HttpContext.Current is a static method that return the current http context

    Context is an instance method defined in the page class that returns the
    current http context (it really just calls the above function).

    -- bruce (sqlwork.com)



    "nalbayo" <> wrote in message
    news:...
    > what's the difference between
    >
    > HttpContext.Current.User.Identity.Name;
    > and
    > Context.User.Identity.Name;
    >
    > thanks!
    >
    >
    >
    Bruce Barker, Nov 11, 2005
    #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. Giovanni Bassi
    Replies:
    0
    Views:
    623
    Giovanni Bassi
    Oct 20, 2003
  2. Dan Bart
    Replies:
    4
    Views:
    27,757
    Andrea D'Onofrio [MSFT]
    Dec 18, 2003
  3. Replies:
    10
    Views:
    3,461
    Kiran_S_Rao
    Dec 8, 2004
  4. Replies:
    5
    Views:
    2,218
    Dominick Baier [DevelopMentor]
    Nov 8, 2005
  5. Tony

    Dim context As HttpContext = HttpContext.Current

    Tony, Mar 2, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    295
    Teemu Keiski
    Mar 3, 2004
Loading...

Share This Page