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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    852
    Giovanni Bassi
    Oct 20, 2003
  2. Dan Bart
    Replies:
    4
    Views:
    29,129
    Andrea D'Onofrio [MSFT]
    Dec 18, 2003
  3. Replies:
    10
    Views:
    3,655
    Kiran_S_Rao
    Dec 8, 2004
  4. =?Utf-8?B?dnZlbms=?=

    Help with HttpContext.Current.User.Identity.Name

    =?Utf-8?B?dnZlbms=?=, Sep 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    721
    Brock Allen
    Sep 29, 2005
  5. Abraham Andres Luna

    HttpContext.Current.User.Identity.Name

    Abraham Andres Luna, Oct 11, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,914
    Edwin Knoppert
    Oct 12, 2006
  6. Doogie
    Replies:
    4
    Views:
    952
    Doogie
    May 1, 2007
  7. Replies:
    5
    Views:
    2,850
    Dominick Baier [DevelopMentor]
    Nov 8, 2005
  8. Tony

    Dim context As HttpContext = HttpContext.Current

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