Thread and session

  • Thread starter Thread starter Lionel
  • Start date Start date
L

Lionel

hi,

I'm trying to call a specific void in a new thread.
it works but if I try to save object in the session via
this void, I've got System.NullReferenceException

thanks for reply.

Lionel
 
here is a part of my code

private void MyVoid()
{
Session["myVar"] = "test"; // EXCEPTION HERE
//......
}

and on click button event...

Thread myThread = new Thread(new ThreadStart(MyVoid));
myThread.Priority = ThreadPriority.Normal;
myThread.Start();

........

Thanks for your reply.

Lionel
 
Lionel said:
here is a part of my code

private void MyVoid()
{
Session["myVar"] = "test"; // EXCEPTION HERE
//......
}

Right, now, what is Session here? It sounds like that's what's null.
 
Back
Top