ComponentOne MultiPage for ASP.NET AJAX: MultiPage for ASP.NET AJAX Task-Based Help > Setting C1MultiPage Behaviors > Loading Pages on Demand

Loading Pages on Demand

To reduce initial page size and load time, you can set C1MultiPage to render only the currently selected page by setting the LoadOnDemand and AutoPostBack properties to True. This topic will describe how to set these properties in Design view, Source view, and in code.

Setting a C1MultiPage to Load on Demand in Design View

To set pages to load on demand, please use the following instructions:

1.   Click the smart tag () to open the C1MultiPage Tasks menu and select MultiPage Designer.

      The C1MultiPage Designer Form opens.

2.   Click the Add Child Item button  twice to add two pages to the C1MultiPage control.

3.   In treeview, select C1MultiPage1 to reveal its list of properties and set the following:

     Set the AutoPostBack property to True.

     Set the LoadOnDemand property to True.

4.   Press OK to close the C1MultiPage Designer Form and run the project. 

Setting a C1MultiPage to Load on Demand in Source View

To set a C1MultiPage to load on demand in Source view , add AutoPostBack="True" and LoadOnDemand="True" to the <cc1:C1MultiPage> tag.  Your HTML will resemble the following:

 

<cc1:C1MultiPage ID="C1MultiPage1" runat="server" AutoPostBack="True" LoadOnDemand="True">

 

Run the project.

Setting a C1MultiPage to Load on Demand in Code

To set a C1MultiPage to load on demand in code, follow these instructions:

1.   Import the following namespace into your project:

      Visual Basic

Imports C1.Web.UI.Controls.C1MultiPage

      C#

using C1.Web.UI.Controls.C1MultiPage;

2.   Add the following code to your Page_Load event:

      Visual Basic

C1MultiPage1.AutoPostBack = True

C1MultiPage1.LoadOnDemand = True

      C#

C1MultiPage1.AutoPostBack = true;

C1MultiPage1.LoadOnDemand = true;

3.   Run the program.


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.