HttpContext.Current

  • Thread starter Thread starter memememe
  • Start date Start date
M

memememe

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.
 
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
 
Back
Top