ComponentOne SiteMap for ASP.NET Web Forms
C1SiteMap Features / Add Tooltips
In This Topic
    Add Tooltips
    In This Topic

    SiteMap allows you to add ToolTips to each node.

    In the Designer

    1. Right click the SiteMap control and select Properties.
    2. Add text to the ToolTip property, for the entire SiteMap control.
    3. Open SiteMap Tasks Menu and select Edit Nodes. This opens the C1SiteMap Designer Form.

    You can select any node and set the ToolTip property for every node.

    In Source View

    Set the ToolTip property within the <cc1:C1SiteMap> tag, to add a ToolTip to the entire control, as shown below:

    Copy Code
    <cc1:C1SiteMap ID="C1SiteMap1" runat="server" ToolTip="This is a SiteMap Control" ShowNodeLines="true" DataSourceID="C1SiteMapDataSource1">
    

    Set the ToolTip property in the <cc1:C1SiteMapNode> tag, to add ToolTip to a single node, as shown below:

    Copy Code
    <cc1:C1SiteMapNode runat="server" Text="C1SiteMapNode1" ToolTip="This is a Node Tooltip">
    

    In Code

    Add the following code to the Page_Load event, to add a ToolTip to the entire control.

    To write code in C#

    C1.SiteMap1.ToolTip = "SiteMap Control";
    

    To write code in Visual Basic

    C1.SiteMap1.ToolTip = "SiteMap Control"
    

    Add the following code to the Page_Load event, to add a ToolTip to individual nodes.

    To write code in C#

    C1SiteMap1.Nodes[0].ToolTip = "Parent1";
    C1SiteMap1.Nodes[0].Nodes[0].ToolTip = "child1";
    C1SiteMap1.Nodes[1].ToolTip = "parent2";
    

    To write code in Visual Basic

    C1SiteMap1.Nodes(0).ToolTip = "Parent1"
    C1SiteMap1.Nodes(0).Nodes(0).ToolTip = "child1"
    C1SiteMap1.Nodes(1).ToolTip = "parent2"
    

    What You've Accomplished

    When you run  the project, hover the mouse over SiteMap nodes. Notice that a tooltip appears on the node.