This is a migrated thread and some comments may be shown as answers.

OA with HttpModule and scriptmanager

1 Answer 57 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Insad
Top achievements
Rank 2
Insad asked on 01 Oct 2010, 10:36 AM
Hello,

I just downloaded the BestPractices (206446_bestpractices). The masterpage example is working fine but we need to use a httpmodule. That example is also working ok as long as you don't use a scriptmanager. When I place a scriptmanager on the page it postback with multiple threads. The first thread is ok but the ones afterwards are getting errors at retrieving the context from the sessionvariable coz it's been cleared by the first thread. What can be done about it, checking before retrieving the session variable is a thing but is there a more elegant way?

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
IT-Als
Top achievements
Rank 1
answered on 01 Oct 2010, 12:48 PM
Hi Insad,

You could try using the current thread id as key to your cached objectscope/context. You can obtain it here:

System.Threading.Thread.CurrentThread.ManagedThreadId

This will ensure that you'll have a unique key for each thread (request) that is spawn from the thread pool that your webapp is running under.

Regards

Henrik
Tags
Getting Started
Asked by
Insad
Top achievements
Rank 2
Answers by
IT-Als
Top achievements
Rank 1
Share this question
or