ComponentOne WebMenus and WebBars for ASP.NET: WebMenus and WebBars for ASP.NET Task-Based Help > C1WebTabStrip Tasks > Creating a C1WebTabStrip Programmatically

Creating a C1WebTabStrip Programmatically

This topic shows how to create C1WebTabStrip group and an item through code. For more details about programmatically creating additional groups and items and creating styles for the C1WebTabStrip, see the tutorial, Creating a C1WebTabStrip in Code.

1.   Add a PlaceHolder control to the Web form.

2.   Import the C1.Web.Command namespace to your source code.

      Visual Basic

Imports C1.Web.Command

      C#

using C1.Web.Command;

3.   To programmatically create a C1WebTabStripGroup use the following code:

      Visual Basic

'First create an instance of the class

Dim tabstrip As New C1.Web.Command.C1WebTabStrip()

'Add the tabstrip to the placeholder control

PlaceHolder1.Controls.Add(tabstrip)

'create the C1WebTabStripGroup

tabstrip.Groups.Add(New C1WebTabStripGroup("Tab 1"))

      C#

//First create an instance of the class

C1WebTabStrip tabstrip = new C1WebTabStrip();

//Add the topicbar to the placeholder control

PlaceHolder1.Controls.Add(tabstrip);

//Create the C1WebTopicBarGroup

tabstrip.Groups.Add(new C1WebTabStripGroup("Tab 1"));

4.   To programmatically create a C1WebTabStripItem, complete the following:

      Visual Basic

' Create the C1WebTabStrip Item

tabstrip.Groups(0).Items.Add(New C1WebTabStripItem("Item 1", "http://www.google.com"))

      C#

//Create the C1WebTabStripItem

tabstrip.Groups[0].Items.Add(new C1WebTabStripItem("Item 1", @"http://www.google.com"));


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