In my page1.aspx, I create a report from the database using a stream.
//on button click Hashtable ht = (Hashtable)Session["ReportParam"]; ReportThreadClass rth = new ReportThreadClass(ht); Thread thread = new System.Threading.ThreadStart(rth .Run); thread.Start();
In my rum class class, I am updating the values ββin the Hashtable, how many pages I have created.
//in thread' method public virtual void Run() { int pagecount=0; while(done) { //loading data from DB and generating html pages ht["Total_Pages"] = pagecount; } }
On my Page2.aspx I read the values ββfrom the session variable
Hashtable ht = (Hashtable)Session["ReportParam"]; int TotalPages = (int) ht["Total_Pages"];
When I run the code in InProc mode, every thing works fine. I get updated values ββfrom the session. Since each thing is stored in a static variable, and ht refers to Session, so it is automatically updated in the session (HashTable does not need to be reassigned to the session).
But when I run the code on the state server (OutProc mode), it needs to store the session data in another process, serializing the Hash table.
But the value of Total_Pages is not updated in Page2.aspx even after Thread is fully executed.
So, is there any event or method that runs to store all updates in the session variable to the server-state, if so, then tell me. if not, pls will offer me some idea to get the updated value in page2.aspx.
source share