ComponentOne TabStrip for ASP.NET AJAX: TabStrip for ASP.NET AJAX Task-Based Help > Binding a C1TabStrip to a Data Source > Binding a C1TabStrip to a SiteMap Data Source

Binding a C1TabStrip to a SiteMap Data Source

In this topic, you will learn how to create a SiteMap, add it to your Web project, and then bind it to a C1TabStrip control.

Complete the following steps:

1.   Create a new ASP.NET AJAX-Enabled Web Site in Visual Studio.

2.   In the Solution Explorer window, right-click on the project and select Add New Item

3.   In the Add New Item dialog box, select Site Map. Notice that the default file name of your new site map is Web.sitemap.

 

     

 

4.   Press Add to leave the Add New Item dialog box.

      The Web.sitemap file is added to your project. 

5.   In Solution Explorer, double-click Web.sitemap to access the file. At this point, the file will only include the following tags:

 

<?xml version="1.0" encoding="utf-8" ?>

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

    <siteMapNode url="" title=""  description="">

        <siteMapNode url="" title=""  description="" />

        <siteMapNode url="" title=""  description="" />

    </siteMapNode>

</siteMap>

 

6.   Replace the pre-existing <siteMapNode> tags with the following XML:

XML Markup

<siteMapNode url="RootNodeUrl" title="Root Node"  description="Root Node Description" >

<siteMapNode url="" title="Products"  description="Products" >

   <siteMapNode url="" title="Studio Enterprise"  description="Studio Enterprise">

     <siteMapNode url="" title="Studio for WinForms"  description="Studio for WinForms" />

     <siteMapNode url="" title="Studio for ASP.NET AJAX"  description="Studio for ASP.NET AJAX" />

     <siteMapNode url="" title="Studio for WPF"  description="Studio for WPF" />

     <siteMapNode url="" title="Studio for Mobile"  description="Studio for Mobile" />

     <siteMapNode url="" title="Studio for ActiveX"  description="Studio for ActiveX" />

     <siteMapNode url="" title="Studio for Silverlight"  description="Studio for Silverlight" />

   </siteMapNode>

     <siteMapNode url="" title="IntelliSpell"  description="IntelliSpell" />

     <siteMapNode url="" title="Report Designer Edition"  description="Report Designer Edition" />

   </siteMapNode>

      <siteMapNode url="" title="Support"  description="Support" >

      <siteMapNode url="" title="Support Services"  description="Support Services" />

      <siteMapNode url="" title="HelpCentral"  description="HelpCentral" />

      <siteMapNode url="" title="Product Forums"  description="Product Forums" />

    </siteMapNode>

    <siteMapNode url="" title="Company"  description="Company" >

      <siteMapNode url="" title="About Us"  description="About Us" />

      <siteMapNode url="" title="Partners"  description="Partners" />

      <siteMapNode url="" title="Contact Us"  description="Contact Us" />

      <siteMapNode url="" title="Join Us"  description="Join Us" />

      <siteMapNode url="" title="Press Center"  description="Press Center" />

      <siteMapNode url="" title="Governance"  description="Governance" />

    </siteMapNode>

    <siteMapNode url="" title="Store"  description="Store">

      <siteMapNode url="" title="Buy Now"  description="Buy Now" />

      <siteMapNode url="" title="Resellers"  description="Resellers" />

    </siteMapNode>

</siteMapNode>

7.   Add a C1TabStrip to your project.

8.   Click C1TabStrip's smart tag () to open the C1TabStrip Tasks menu.

9.   In the C1TabStrip Tasks menu, select <New Data Source…> from the Choose Data Source drop-down box. 

The Data Source Configuration Wizard appears.

10.  In the Data Source Configuration Wizard  wizard, select Site Map as your data source and then click OK.

11.  Run the project.

  This Topic Illustrates the Following:

The tab hierarchy of the C1TabStrip now reflects the information in the Web.Sitemap file. Your result should resemble the following image:

 


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