Click here to Skip to main content
15,915,324 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I have page1.aspx, in page load I have function which will be called in Thread as
MSIL
if (isEmail == 1)
           {
               //objmyClass.deliveryType = "email";
               Thread cwpThread = new Thread(new ParameterizedThreadStart(ProcessMyList));
               abc.Start("email");

           }
           if (isFax == 1)
           {
               //objmyClass.deliveryType = "fax";
               Thread abc = new Thread(new ParameterizedThreadStart(ProcessMyList));
               abc.Start("fax");
           }


In the above code ProcessMyList will be called in thread & in this function I am assigning session values as
MIDL
Session["EmailFileIds"] = "1234";
           Session["FaxFileIds"] = "4321";

. But when I navigate to another page, I am not able to read these session values.

help me in this regard.

Thanks
Posted

The state that is available to all threads are the static values. When a new request is made by a client a new thread is created for it and an instance of HttpContext as well. But when you create a new thread the state isn't passed to it automatically. And this is a good thing as most of your state should be specific only to the current thread.
 
Share this answer
 
Comments
[no name] 7-Jun-11 6:14am    
Ok sounds great. But how to achieve it.
Can u post sample / Pseudo code regard to this.
Have you used the debugger to make sure they're even being set?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900