G
Guest
I have a page that performs a number of tasks and runs awhile. I have successfully used threads to launch a long-running process and provide a periodic update ("Now processing x...") on a destination page in previous cases, but for some reason, this technique is not working for me now. Here's the code
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Clic
Launch_Thread(
End Su
Sub Launch_Thread(
Dim NewThread As Thread = New Thread(AddressOf Execute_Update
NewThread.Priority = ThreadPriority.Lowes
NewThread.Start(
Response.Redirect("DataLoadResults.aspx") 'Page that refreshes to display progres
End Su
Sub Execute_Update(
'Blows up right her
SyncLock Session.SyncRoo
Session.Item("results") = Session.Item("results") & "Starting up...<BR>
End SyncLoc
.... (rest of sub
End Su
The error I get is
"Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive
I've checked, double-checked, rechecked -- Machine.config, web.config, I'm even overtly setting enableSessionState=true in the page directive for the pages involved, and still no luck
I've used an identical approach in prior cases and it's worked great, but for some reason I'm not able to access the session state in the launched thread here. The only difference in this case is that the code BEYOND where it blows up is querying both Oracle and SQL Server databases, but since I'm blowing up on the Synclock statement, I don't think that matters. I'm running v1.1.4322 of the framework, if that matters, and would welcome any insight
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Clic
Launch_Thread(
End Su
Sub Launch_Thread(
Dim NewThread As Thread = New Thread(AddressOf Execute_Update
NewThread.Priority = ThreadPriority.Lowes
NewThread.Start(
Response.Redirect("DataLoadResults.aspx") 'Page that refreshes to display progres
End Su
Sub Execute_Update(
'Blows up right her
SyncLock Session.SyncRoo
Session.Item("results") = Session.Item("results") & "Starting up...<BR>
End SyncLoc
.... (rest of sub
End Su
The error I get is
"Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive
I've checked, double-checked, rechecked -- Machine.config, web.config, I'm even overtly setting enableSessionState=true in the page directive for the pages involved, and still no luck
I've used an identical approach in prior cases and it's worked great, but for some reason I'm not able to access the session state in the launched thread here. The only difference in this case is that the code BEYOND where it blows up is querying both Oracle and SQL Server databases, but since I'm blowing up on the Synclock statement, I don't think that matters. I'm running v1.1.4322 of the framework, if that matters, and would welcome any insight