Showing posts with label course. Show all posts
Showing posts with label course. Show all posts

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?

hello.

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.

Cheers


hello.

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.

Saturday, March 24, 2012

Panel or Multiview inside Updatepanel, whats faster?

So I have multiple gridviews to display on a single page. There are multiple ways to display these one at a time. The first would, of course, be a multiview, the second, a set of panels using the visible attrib to control the views. Normally, a multiview would be a great way to do this, but when one adds an update panel what is best way to build the page when render speed is considered.

The multiview must, of course, sit in one updatepanel, therefore making the page render the entire section of code on each async postback. This would mimic the behavior of putting all the panels in one updatepanel. However, when one puts each panel inside its own updatepanel, it would seem to me that rendering would speed up, since the asyncpostback only has to return HTML related to its own individual gridview.

Anyone have any ideas on this?

Also, sort of related to this:

When all the panels are inside a table cell <td> and right on top of each other, so:

<td>

<asp:updatepanel id="test" runat="server">

<contenttemplate>

<panel id="pnl1" runat="server">

stuff

</panel>

</contenttemplate>

</asp:updatepanel>

<asp:updatepanel id="test2" runat="server">

<contenttemplate>

<panel id="pnl2" runat="server">

stuff

</panel>

</contenttemplate>

</asp:updatepanel>

</td>

When the first panel or pnl1 is rendered visible=false, the second panel pushes down the screen about 30px, yet when I remove the updatepanels, the panel shows up without the 30px push. I have not really investigated this too much, but if someone has seen this type of issue and knows a quick fix, I would be appreciative.

THanks

Jason

I think all in all they will render about the same amount of HTML - and the server side processing should be the same with both. If anything the multi-view will be a bit slower due to the extra-overhead the control might have - but i'm talking miliseconds or smaller.

Remember when a panel has visible=False - nothing inside that panel is rendered to the clients computer.

regarding the push down - have you looked with the developer tools in IE / FireFox to see what block element is pushing it down?


Sounds good. I'll just go w/the multiview then and make life a bit easier, this will solve the 30px push as well so I will mark this as solved.