Avoid loading user control with UserControlLoader

  1. #1

    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)

      <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 :)
  2. #2
    Hi @Rahnzo,

    I guess the only way to achieve your requirement is to use dynamic rendering of user controls that, as you said, you don't want to use.

Similar Threads

  1. Replies: 2
    Last Post: Dec 19, 2013, 10:54 AM
  2. Replies: 3
    Last Post: Sep 05, 2013, 8:18 AM
  3. Replies: 2
    Last Post: May 09, 2013, 3:41 PM
  4. Replies: 0
    Last Post: May 16, 2012, 11:29 PM
  5. Replies: 3
    Last Post: Feb 03, 2012, 4:07 PM

Posting Permissions