HttpContext.Current

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

Natty Gur

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top