A
Alvin Bruney [MVP]
Child threads aren't allowed to touch main thread objects. The session
object in ASP.NET belongs to the main thread. The way around this is to pass
in a reference in the thread constructor so that the child thread can use
the object safely since there is no control.invoke available like in
winforms.
Why does this work? This has been bugging for a while.
So the class would look something like this:
public class test
{
public test(HttpContext currObject);.....
and the call would be test t = new (HttpContext.Current);
Technically, I can't see what is happening behind the scenes to force thread
safety. Anybody?
object in ASP.NET belongs to the main thread. The way around this is to pass
in a reference in the thread constructor so that the child thread can use
the object safely since there is no control.invoke available like in
winforms.
Why does this work? This has been bugging for a while.
So the class would look something like this:
public class test
{
public test(HttpContext currObject);.....
and the call would be test t = new (HttpContext.Current);
Technically, I can't see what is happening behind the scenes to force thread
safety. Anybody?