asp.net.ph

Skip Navigation Links

Adding TabStrip Controls to a Web Forms Page

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


Essentially, to create a working TabStrip control, you need to add the control to the page, specify the set of Tab elements the control will contain, and add some code for handling the response of the different tabs.

The below procedures show the minimum steps needed to display a TabStrip control.

To add a TabStrip control to a Web Forms page

  1. At the top of the Web Form, before any document structure markup, add the @ Import directive, which should look like the following:
    <%@ Import namespace="Microsoft.Web.UI.WebControls" %>

    NOTE: In this example, the @ Import directive is optional. This directive is only required when writing Web Forms that use server-side script to create or modify WebControls objects.

  2. On the next line, add the @ Register directive.
    <%@ Register tagprefix="ie" namespace="Microsoft.Web.UI.WebControls" 
    assembly="Microsoft.Web.UI.WebControls" %>
  3. On the <body> section of the document structure, declare the <ie:tabstrip> element and optionally set the control’s base properties.

    NOTE: All WebControls elements must be authored within a <form runat="server"></form> element, and the Web Form’s markup should look similar to the following.

  4. <body>
       <form runat="server">
          <ie:tabstrip id="tabstrip1" runat="server">
    
             ... individual tabs markup goes here ...
    
          </ie:tabstrip>
       </form>
    </body>
  5. Add Tab elements as child elements of the TabStrip element.

    NOTE: How tabs are added to the TabStrip control depends on whether you will display a static set of tabs or a set of tabs generated dynamically at run time.

    For this example, we use statically defined Tab elements. At this point, the Web Form’s markup should look similar to the following.

    <ie:tabstrip id="tabstrip1" runat="server" ... >
    
       <ie:tab text="Page 1" />
    
       <ie:tab text="Page 2" />
    
    </ie:tabstrip>
TabStrip with Default Settings
Run Sample | View Source
See Also

Customizing the TabStrip Control User Interface   Using the TabStrip with the MultiPage 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