OA with HttpModule and scriptmanager

2 posts, 1 answers
  1. Insad
    Insad avatar
    17 posts
    Member since:
    Jan 2010

    Posted 01 Oct 2010 Link to this post

    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
  2. Answer
    TSE
    TSE avatar
    381 posts
    Member since:
    Sep 2008

    Posted 01 Oct 2010 Link to this post

    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
  3. DevCraft banner
Back to Top