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.

No comments:

Post a Comment