HttpContext.Current

Discussion in 'ASP .Net' started by memememe, Jul 18, 2003.

  1. memememe

    memememe Guest

    Now how in the wolrd does that work? How does it know that some static
    method I called on some library was called by a page that had that context?
    I have tried it so far with my Utils class, and it works just fine when
    called from a page (all my methods are static), but I have also tried it by
    spawning a thread that grabs the same HttpContext.Current, and that appears
    to be null. So how does HttpContext.Current know which context to grab? im
    justa little scared to use thats all, until now all my static methods had
    the context passed to them.
     
    memememe, Jul 18, 2003
    #1
    1. Advertising

  2. memememe

    Natty Gur Guest

    Hi,

    The Current static method will work without any problem on the current
    thread. If you want to create new thread and work with the context you
    can pass it as parameter to the thread. You can see my example:
    http://www.developersdex.com/gurus/code/662.asp

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Natty Gur, Jul 20, 2003
    #2
    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. Nayt Grochowski
    Replies:
    1
    Views:
    460
    Nayt Grochowski
    Aug 1, 2003
  2. Giovanni Bassi
    Replies:
    0
    Views:
    661
    Giovanni Bassi
    Oct 20, 2003
  3. Anthony Williams
    Replies:
    8
    Views:
    6,138
    Matt Yaeger
    Aug 26, 2004
  4. Dan Bart
    Replies:
    4
    Views:
    27,928
    Andrea D'Onofrio [MSFT]
    Dec 18, 2003
  5. Tony

    Dim context As HttpContext = HttpContext.Current

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

Share This Page