| Site Navigation |
| |
| SiteMapPath Control |
| |
| The SiteMapPath control presents a navigation path which is also famous as a breadcrumb or eyebrow which means that it shows the user the current page location and displays links as a path back to the home page. The visual look of site-navigation controls can be personalized by setting the attributes of the control, or by organizing the templates that are available for the control. Templates and styles are applied to links according to rules of precedence. |
| |
| The SiteMapPath control gets navigation data from a site map. This data includes information about the pages in your Web site, such as the URL, title, description, and location in the navigation hierarchy. Storing your navigation data in one place makes it easier to add and remove items in the navigational menus of your Web site. |
| |
| By using SiteMapPath control, users can to navigate backward from the current page to pages that are higher in the site hierarchy. However, the SiteMapPath control does not allow you to navigate forward from the current page to another page that is lower in the site hierarchy. |
| |
| Data Display Using SiteMapPath control |
| |
| It does not use the SiteMapDataSource to display data like the TreeView control and Menu control. The SiteMapPath control depends on a SiteMapProvider to fetch the data, which uses an XML file, web.sitemap. An XML file and web.sitemap consist of URLs and other information regarding pages to be displayed. The SiteMap control displays only those data whose URL is present in the specified SiteMapProvider. If web.sitemap file contains any error (in syntax or in logic) then SiteMapProvider will not display the desired output. |
| |
| Setting Behavior of SiteMapPath |
| |
| The SiteMapPath control has various common properties to modify the display appearance. These properties are following: |
| |
| ParentLevelDisplayed: This property is set to -1, which is default. It means that all parent levels in the XML file are displayed. You can set any integer value like 1, 2, or 3 to specify the n-level of the hierarchy along with the current page. |
| |
| PathDirection: This property changes the direction of the links generated in the output of a page. The two available settings for this property are RootToCurrent and CurrentToRoot, the RootToCurrent is default. The Root link is the first link in the display, which is normally a Home page. |
| |
| PathSeparator: The SiteMapPath control uses a greater than sign (>) as a link elements separator, which is default. A new value can be assigned to PathSeparator property. You can also set this property by specifying <PathSeparatorTemplate> element and a style can be added using <PathSeparatorStyle> element. |
| |
| ShowToolTips: BY default, the SiteMapPath control generates tool tips for each link if description property is used in a web.sitemap. If no tool tips are needed, you simply set this property to false. |
| |
|
| |