Monday, March 26, 2012

PageRequestManager blocks any other instance of XMLHttpRequest?

I'm trying to implement a progress bar that reports on the contents of session variables during the course of a slow method on one of my pages. The slow method in question populates/updates a datagrid inside an update panel.

I'm aware that it's only possible to have one request at a time using PageRequestManager, so i thought i would use some of my old own ajax libraries, and make a manual call to a webservice which would return the contents of the relevant session variables. However, even using this approach, the call to the webservice does not go through until the slow method has finished, which is obviously not ideal. Does PageRequestManager block any other instances of XmlHttpRequest on the page?

I read an article that suggested what i was attempting to do was possible using PageMethods, but since the latest release, where pagemethods have to not only reside in the aspx file but also have to be static, this is just not feasible.

I'd be grateful if anyone could shed some light on this, cheers

I'm not sure if something is awry with my installation, but now i am unable to request any other page from within the current application whilst the ajax request is in process - it just hangs, and then processes when the current ajax operation is complete. For slow methods that retrieve a lot of data, i'm sure you can see why this is almost ludicrous behaviour. Surely this isn't intended?


in previous releases, you could only make a partial refresh at a time (ie, you could only start a partial refresh after a previous one ended). in the last version, i think this has been changed and now what happens is that the last request overrides the previous one. this only happens when you're using UpdatePanels (ie, the behavior i've described only happens when you use updatepanels). you can still use xmlhttprequest as you see fit in your pages and you should be able to make several calls.

Thanks for the reply.

Are you aware of any other scenario in which setting a long running method running on one page would block any other requests to other pages within the same application until it is complete? I'm not accessing or modifying session data in either page.



well, even though you're not using session data, it all depends on the way your final page is rendered. for instance, i think that if you don't set the enableSessionstate attribute on the page directive, the page will still use read/write session state. do you think that this might be the problem you're having?

I was unaware i had to specifically set the enableSessionState directive to "false" - even "readonly" still made the page block.

Thanks a lot for the help, appreciated.

No comments:

Post a Comment