Why are my asp.net pages getting accessed synchronously?
I have a Me开发者_如何学JAVAnu page. If a user selects an Menu Item it opens a new IE Window using JavaScript. So user can open different parts of applications in multiple IE Windows. These Windows have the same Session. My issue is that these pages are accessed synchronously? If one of the child window is waiting for an action to be finished no other request from any other child window is processed. Is it because of using Session variables?
Update: This is only happening to the windows having the same parent. If I have IE child windows from different parent windows then this issue is not there.
Yes, if each page is using the session, then asp.net will serialize activity against it. If one or more of these sub-pages only need read only access, then mark that in your @Page directives (e.g. EnableSessionState="ReadOnly"), or turn it off completely if the session information isn't used.
Generally, it's a bad plan to have long-running activities pending on the server, and as you've found, this is especially true if they're using the session.
Edit Last FAQ here also describes this serialization.
Edit 2 In response to comment re: closing the child window:
It will eventually process other requests, once the server side process finishes whatever request it's been working on. Closing a child window does not abort the request on the server side. Best you can hope is that the long-running request has a chance to check IsClientConnected every so often, and aborts its processing if it's no longer relevant.
From the server perspective, you have absolutely no way to know how many browser windows the client has open.
So, no, they are not synchronous.
精彩评论