Sep 27, 2014, 7:45 PM
Avoid loading user control with UserControlLoader
Hi guys!
I have a doubt about UserControlLoader:
I have the following panel with many usercontrolloader controls (In the example there is 3 but in my app I have around 20 - 30)
In the page_load of main page which has the pnlActivities I decide which of the panel user controls make visible. The problem is that when the main page load, all usercontrols load too automatically, slowing the page load time. When in the main page_load I set the usercontrolloader controls to hidden all controls load as well.
My question is: There is a way of, when the page load, in a if statement decide what user controls will be loaded before each of them load in order to
improve performance and avoid to load specific user controls from code behind?
Thanks a lot Ext.NET team :)
I have a doubt about UserControlLoader:
I have the following panel with many usercontrolloader controls (In the example there is 3 but in my app I have around 20 - 30)
<ext:Panel
ID="pnlActivities"
runat="server"
Header="false"
Padding="5"
AutoScroll="True"
Height="600">
<Items>
<ext:Panel ID="pnlAct1" runat="server" Icon="Email" StyleSpec="padding: 10px;" Border="false" Hidden="true">
<Items>
<ext:UserControlLoader runat="server" Path="/Maintenances/UserControls/JobActivities/uc1.ascx" ID="uc1"></ext:UserControlLoader>
<ext:UserControlLoader runat="server" Path="/Maintenances/UserControls/JobActivities/uc2.ascx" ID="uc2"></ext:UserControlLoader>
<ext:UserControlLoader runat="server" Path="/Maintenances/UserControls/JobActivities/uc3.ascx" ID="uc2"></ext:UserControlLoader>
</Items>
</ext:Panel>
</Items>
</ext:Panel>
I don't want to use dynamic usercontrol because this is more complex and I had many problems when I used it.In the page_load of main page which has the pnlActivities I decide which of the panel user controls make visible. The problem is that when the main page load, all usercontrols load too automatically, slowing the page load time. When in the main page_load I set the usercontrolloader controls to hidden all controls load as well.
My question is: There is a way of, when the page load, in a if statement decide what user controls will be loaded before each of them load in order to
improve performance and avoid to load specific user controls from code behind?
Thanks a lot Ext.NET team :)