ComponentOne SiteMap for ASP.NET Web Forms
C1SiteMapDataSource Features / Add a SiteMap File
In This Topic
    Add a SiteMap File
    In This Topic

    You can populate the C1SiteMapDataSource control by adding a SiteMap file to it.

    In the Designer

    Complete the following steps to add a .sitemap file to the C1SiteMapDataSource control.

    1. Add the .sitemap file to the project.
    2. Right click the C1SiteMapDataSource control and select Properties.
    3. In the Properties Window, click the ellipsis button (...) next to SiteMapFile property.
    4. Select the .sitemap file in the Choose a source SiteMap file dialog box and click OK.

    In Source View

    Set the SiteMapFile property in the <cc1:C1SiteMapDataSource /> tag, to add a .sitemap file in Source View.

    Copy Code
    <cc1:C1SiteMapDataSource ID="C1SiteMapDataSource1" runat="server" SiteMapFile="~/web1.sitemap"
        />
    

    In Code

    Add the following code to the Page_Load event, to add a .sitemap file to the C1SiteMapDataSourceControl.

    To write code in C#

    C1SiteMapDataSource1.SiteMapFile = "web1.sitemap";
    

    To write code In Visual Basic

    C1SiteMapDataSource1.SiteMapFile = "web1.sitemap"