New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Server-side Events

RadSiteMap introduces two server-side events for working with nodes:

  • NodeCreated occurs when a new node is added to the control (at any level)
  • NodeDataBound occurs when a node is bound to a data source

This example shows how to use the NodeDataBound event to filter certain nodes. The nodes are then processed in the DataBound event and the total children count for each node is displayed.

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="DefaultVB.aspx.vb" Inherits="SiteMap.Examples.ServerEvents.DefaultVB" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <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"

    <div class="demo-container">
        <telerik:RadSiteMap runat="server" ID="SiteMap1" DataSourceID="RadSiteMapDataSource1">
                <telerik:SiteMapLevelSetting Level="0">
                    <ListLayout RepeatColumns="3" RepeatDirection="Horizontal" AlignRows="true"></ListLayout>
                <telerik:RadSiteMapNodeBinding NavigateUrl="#"></telerik:RadSiteMapNodeBinding>

Support & Learning Resources

Find Assistance