Search
Author
ASP.NET Tutorials
Author
Sheo Narayan
Advertisements


Winners

Win Prizes

Social Presence
Like us on Facebook

Silverlight Tutorials | Report a Bug in the Tutorial
asp:SiteMapDataSource control
The SiteMapDataSource control is used as a data source to place a site map (breadcrumbs) to the website. A site map is a way to present all folders and pages of the website.
 
The SiteMapDataSource control is used as a data source to place a site map (breadcrumbs) to the website. A site map is a way to present all folders and pages of the website. A site map is a way to present all folders and pages of the website. The site map information can appear in many forms. SiteMapDataSource control is used generally as a data source for asp:SiteMapPath control.

By default, this control takes root's web.sitemap file as the source file to display sitemap.



Some Important Properties of SiteMapDataSource Control
SiteMapProvider Gets or sets the name of the site map provider. This information is written in web.config file.
StartingUrlNode Used to set the URL in the sitemap that will be considered as root.
ShowStartingNode true/false. Whether to show starting node or not.
DEMO : SiteMapDataSource Show Source Code
Skip Navigation LinksHome > Tutorials > SiteMapDataSource control tutorials  
                    
                    
// SiteMapPath Control ///////////////////////////////
<asp:SiteMapPath runat="Server" ID="SiteMapPath1" BorderWidth="1" BorderStyle="dotted" BorderColor="red">
</asp:SiteMapPath>

// SiteMapNode used to display SiteMap ///////////////////////////////
// Place following code into web.sitemap file and place it into the root folder of your application
<siteMapNode url="~/default.aspx" title="Home"  description="Go to home page">
    <siteMapNode url="~/tutorials/default.aspx" title="Tutorials"  description=".NET Tutorials">
      <siteMapNode url="~/tutorials/controls/sitemapdatasource.aspx" title="SiteMapDataSource Control" description="SiteMapDataSource Control tutorials" />
    </siteMapNode>
</siteMapNode>