asp.net.ph

Skip Navigation Links

Nesting MultiPage Controls

Controls You Can Use on Web Forms   ASP.NET IE WebControls   MultiPage WebControl


MultiPage controls can be nested, or used within another MultiPage.

This is particularly useful when presenting subsets of pages within the main set of pages. This section briefly explores an example that includes the previous MultiPage sample ( showing thumbnails and full images ), nested within another MultiPage.

The below procedures show the minimum steps needed to display nested MultiPage controls.

To add nested MultiPage controls to a Web Forms page

  1. Add the processing directives. See Adding MultiPage Controls to a Web Forms Page.
  2. On the <body> section of the document structure, declare the <ie:multipage> elements and optionally set the controls’ base properties.

    Nesting MultiPage elements is pretty straightforward, with markup taking the following form.

    <ie:multipage id="multipage1" runat="server">
    
          <ie:pageview id="page1">
             ... page1 content goes here ...
          </ie:pageview>
    
          <ie:pageview id="page2">
    
             <ie:multipage id="multipage2" runat="server">
    
                <ie:pageview id="subpageA">
                   ... subpageA content goes here ...
                </ie:pageview>
    
                <ie:pageview id="subpageB">
                   ... subpageB content goes here ...
                </ie:pageview>
    
             </ie:multipage>
    
          </ie:pageview>
    
       </ie:multipage>
  3. Next, add the interface to enable the user to navigate the main set of pages.

    For this example, we use <asp:button> controls.

    <asp:button id="btnBack" runat="server" font-size=9pt
       text="< Back" onclick="backClick" /> 
    <asp:button id="btnNext" runat="server" font-size=9pt
       text="Next >" onclick="nextClick" />
  4. Lastly, add code to handle the navigation.

    Basically when either of the buttons is clicked in this example, the corresponding handler simply increments or decrements the SelectedIndex property of the MultiPage.

    public void nextClick ( object sender, EventArgs e ) {
       if ( cityInfo.SelectedIndex < ( cityInfo.Controls.Count - 1 ) ) {
          cityInfo.SelectedIndex ++;
          setButtons ( );
       }
    }
    
    public void backClick ( object sender, EventArgs e ) {
       if ( cityInfo.SelectedIndex > 0 ) {
          cityInfo.SelectedIndex --;
          setButtons ( );
       }
    }
Nested MultiPage Controls
Run Sample | View Source

The links to the sections below illustrate further ways of implementing navigation within a MultiPage control.

See Also

Using MultiPage Controls in a Templated Control   Using the MultiPage with the TabStrip WebControl



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note