PDA

View Full Version : [CLOSED] MasterPage best practice



jchau
Jun 21, 2013, 7:54 PM
Just wondering if you guys can take a look at our current MasterPage and see if we can speed up rendering anymore. Our page is pretty simple with a pnlHeader and a pnlContent. We are currently wrapping the ContentPlaceHolder in a Container. Is there a way to bypass that? I feel using Content of Container control can be slow, especially when the ContentPlaceHolder for the actual page is a BorderLayout.



<ext:ResourceManager ID="extScriptMgr" runat="server" IDMode="Static" StateProvider="None"
Namespace="">
</ext:ResourceManager>
<ext:Viewport ID="extViewPort" runat="server">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:Container ID="pnlHeader" runat="server" Cls="header-height" Height="66">
</ext:Container>
<ext:Container ID="pnlContent" runat="server" Flex="1" Layout="FitLayout">
<Content>
<asp:ContentPlaceHolder runat="server" ID="c">
</asp:ContentPlaceHolder>
</Content>
</ext:Container>
</Items>
</ext:Viewport>

Baidaly
Jun 22, 2013, 12:59 AM
Hello!

Actually, I don't see another viable option for this case. However, I'll ask my colleagues to advice you.

michaeld
Jun 22, 2013, 1:12 AM
I had to do it this way too, but am interested to if there is any better way myself.

Daniil
Jun 24, 2013, 6:43 AM
Hi @jchau,

Placing a non-Ext.NET control into a container's (Vewport in your case) is not possible. So, wrapping it in a Container is a single way.

Putting a ContentPlaceHolder to a Container's Content is also the only solution. Though, if it works for you with Layout="FitLayout", it means that there is an Ext.Net top-level control in the place holder's content. Otherwise, you would get an Exception like "layout can't handle a non-Ext.NET component". So, it is actually added as a Container's item (i.e. going to its Items collection). So, I don't think it slows down the page even for a bit.