ASP.NET Navigation controls uses SiteMapPath control to retrieve the navigation information on the website. A SiteMap represent the relationship between the pages in an application. Site Maps Use the Provider Data model. This post explains about default XML Site Map provider, which enables you to store a Site Map in an XML file.
Site Map file contains <siteMpNode> elements. You declare a SiteMapPath control on page and it automatically uses the web.sitemap file located in the root directory.
Add a sitepath control to your we page. You do not need to add to every page in your web site, If you add a SiteMapPath control to a master page then you can display the control automatically on every page.
Adding SiteMapPath control to Masterpage
Add a sitemap xml file to your root in website. The file named with web.sitemap. root is the default location where sitemappath control looks for this file.
When you run the application you will see the following output
The solution structure for the project will look like
When you navigated to the Architecture department the site map looks like
In the next post I am going to explain about other navigation controls Menu,Tab and Tree View controls.
|Share this post :|