Share via


SiteMapDataSource Web Server Control Overview

The SiteMapDataSource Web server control is used with ASP.NET Site Navigation. The SiteMapDataSource retrieves navigation data from a site map provider and passes the data to controls that can display that data, such as the TreeView and Menu controls.

This topic contains:

  • Background

  • Code Examples

  • Class Reference

Background

The SiteMapDataSource Web server control retrieves navigation data from a site-map provider, and then passes the data to controls that can display that data, such as the TreeView and Menu controls.

Note

The SiteMap control also displays navigation data, but it does not need to bind to the SiteMapDataSource control. For more information, see ASP.NET Site Navigation Overview.

The SiteMapDataSource control obtains 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.

In earlier versions of ASP and ASP.NET, when you added a page to your Web site and then added a link to that new page from every other page in the Web site, you had to add the links manually, include a common file, or develop custom navigation functionality. ASP.NET version 2.0 includes navigation controls that make it easier for you to create, customize, and maintain navigational menus.

Back to top

Code Examples

How to: Display Site-Map Data in Non-Hierarchical Web Server Controls

How to: Add Simple Site Navigation

How to: Filter the Nodes Retrieved by SiteMapDataSource Web Server Controls

Back to top

Class Reference

The following table lists the key classes that relate to the SiteMapDataSource control.

Member

Description

SiteMapDataSource

The main class for the control.

SiteMapPath

Displays a set of text or image hyperlinks and can bind to the SiteMapDataSource control.

TreeView

Displays hierarchical data in a tree structure and can bind to the SiteMapDataSource control.

Menu

Displays a menu and can bind to the SiteMapDataSource control.

Back to top

See Also

Concepts

ASP.NET Site Navigation Overview

Securing ASP.NET Site Navigation

Securing Data Access

Reference

XmlSiteMapProvider

Other Resources

ASP.NET Application Security in Hosted Environments