SiteMap - Customizing Appearance

Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

The semantic markup rendered by RadSiteMap yields itself to easy and flexible styling using CSS.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="SiteMap.Examples.CustomizingAppearance.DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadSiteMapDataSource runat="server" ID="RadSiteMapDataSource1" ShowStartingNode="false"
        SiteMapFile="~/Examples.sitemap"></telerik:RadSiteMapDataSource>

    <div class="demo-container no-bg">
        <telerik:RadSiteMap runat="server" ID="RadSiteMap1" Skin="Default" DataSourceID="RadSiteMapDataSource1"
            MaxDataBindDepth="2" OnNodeDataBound="SiteMap1_NodeDataBound">
            <LevelSettings>
                <telerik:SiteMapLevelSetting Level="0" MaximumNodes="3">
                    <ListLayout RepeatDirection="Vertical" RepeatColumns="3"></ListLayout>
                    <NodeTemplate>
                        <h3 class="Header">
                            <%# DataBinder.Eval(Container.DataItem, "title") %>
                        </h3>
                    </NodeTemplate>
                </telerik:SiteMapLevelSetting>
            </LevelSettings>
        </telerik:RadSiteMap>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?