ASP.NET Syntax ASP.NET Syntax for Web Controls
Provides a data source control that Web server controls and other controls can use to bind to hierarchical site map data.
Declarative Syntax
<asp:SiteMapDataSource
EnableTheming = "True|False"
EnableViewState = "True|False"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
runat = "server"
ShowStartingNode = "True|False"
SiteMapProvider = "string"
SkinID = "string"
StartFromCurrentNode = "True|False"
StartingNodeOffset = integer
StartingNodeUrl = "uri"
Visible = "True|False"
/>
For information on the individual members of this class, see SiteMapDataSource in the class library.
The SiteMapDataSource control is a data source to the site map data that is stored by the site map providers that are configured for your site. The SiteMapDataSource enables Web server controls that are not specifically site navigation controls, such as the TreeView, Menu, and DropDownList controls, to bind to hierarchical site map data. You can use these Web server controls to display a site map as a table of contents or to actively navigate a site. Alternatively, you can use the SiteMapPath control, which is designed specifically as a site navigation control and therefore does not need an instance of the SiteMapDataSource control.
For more information on using the SiteMapDataSource control, see SiteMapDataSource Web Server Control.
The following example demonstrates how to declaratively bind a TreeView control to a site map using a SiteMapDataSource control. The site map data is retrieved beginning at the root node level.
<asp:treeview id="myTreeView" runat="server"
datasourceid="siteMap"
expanddepth=1 />
<asp:sitemapdatasource id="siteMap" runat="server" />
Show me
SiteMapDataSource Class SiteMapDataSource Web Server Control