Saturday, March 24, 2012

UploadPanel and Session problem

I have an UpdatePanel and a simple asp Button inside it, that produces asynchronous postbacks to server. Server-side onButton_Click event handling is a lasting operation(about 5 sec) thats why if async postback is in process user should be able to go to another page or make any actions.

Everything works fine unless the session object is used anywhere in application(not even in the button on click handler!). If session object is used IE doesnt allow you to make any type of postback while current async postback is in progress.

Has enyone encountered such a problem? Please Help!

Hi,

Asp.net is typical a multi-thread environment, and for thread safety, page requests using session state internally use a ReaderWriterLock to manage access to the session state.So, the second request will not be able to access it untill the lock by the previous request is released.

It should work if the second page doesn't make use of session or use <a> tag to perform redirection.


Hope this helps.

No comments:

Post a Comment