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.
- 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.
- On the next line, add the @ Register directive.
<%@ Register tagprefix="ie" namespace="Microsoft.Web.UI.WebControls"
assembly="Microsoft.Web.UI.WebControls" %>
- 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.
<body>
<form runat="server">
<ie:tabstrip id="tabstrip1" runat="server">
... individual tabs markup goes here ...
</ie:tabstrip>
</form>
</body>
- 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>
Customizing the TabStrip Control User Interface Using the TabStrip with the MultiPage WebControl