.NET Framework Class Library SiteMapDataSource Class Provides a data source control that Web server controls and other controls can use to bind to hierarchical site map data.

Inheritance Hierarchy
Namespace:
System.Web.UI.WebControls
Assembly:
System.Web (in System.Web.dll)

Syntax
<ToolboxBitmapAttribute(GetType(SiteMapDataSource))> _
Public Class SiteMapDataSource _
Inherits HierarchicalDataSourceControl _
Implements IDataSource, IListSource
[ToolboxBitmapAttribute(typeof(SiteMapDataSource))]
public class SiteMapDataSource : HierarchicalDataSourceControl,
IDataSource, IListSource
[ToolboxBitmapAttribute(typeof(SiteMapDataSource))]
public ref class SiteMapDataSource : public HierarchicalDataSourceControl,
IDataSource, IListSource
[<ToolboxBitmapAttribute(typeof(SiteMapDataSource))>]
type SiteMapDataSource =
class
inherit HierarchicalDataSourceControl
interface IDataSource
interface IListSource
end
<asp:SiteMapDataSource />
The SiteMapDataSource type exposes the following members.

Constructors

Properties

Methods
|
| Name | Description |
|---|
.gif) | AddedControl | Called after a child control is added to the Controls collection of the Control object. (Inherited from Control.) | .gif) | AddParsedSubObject | Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object. (Inherited from Control.) | .gif) | ApplyStyleSheetSkin | Applies the style properties that are defined in the page style sheet to the control. (Inherited from HierarchicalDataSourceControl.) | .gif) | BuildProfileTree | Infrastructure. Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page. (Inherited from Control.) | .gif) | ClearCachedClientID | Infrastructure. Sets the cached ClientID value to nullNothingnullptra null reference (Nothing in Visual Basic). (Inherited from Control.) | .gif) | ClearChildControlState | Deletes the control-state information for the server control's child controls. (Inherited from Control.) | .gif) | ClearChildState | Deletes the view-state and control-state information for all the server control's child controls. (Inherited from Control.) | .gif) | ClearChildViewState | Deletes the view-state information for all the server control's child controls. (Inherited from Control.) | .gif) | ClearEffectiveClientIDMode | Infrastructure. Sets the ClientIDMode property of the current control instance and of any child controls to Inherit. (Inherited from Control.) | .gif) | CreateChildControls | Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. (Inherited from Control.) | .gif) | CreateControlCollection | Creates a new ControlCollection object to hold the child controls (both literal and server) of the server control. (Inherited from HierarchicalDataSourceControl.) | .gif) | DataBind()()() | Binds a data source to the invoked server control and all its child controls. (Inherited from Control.) | .gif) | DataBind(Boolean) | Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event. (Inherited from Control.) | .gif) | DataBindChildren | Binds a data source to the server control's child controls. (Inherited from Control.) | .gif) | Dispose | Enables a server control to perform final clean up before it is released from memory. (Inherited from Control.) | .gif) | EnsureChildControls | Determines whether the server control contains child controls. If it does not, it creates child controls. (Inherited from Control.) | .gif) | EnsureID | Creates an identifier for controls that do not have an identifier assigned. (Inherited from Control.) | .gif) | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | .gif) | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | .gif) | FindControl(String) | Searches the current naming container for a server control with the specified id parameter. (Inherited from HierarchicalDataSourceControl.) | .gif) | FindControl(String, Int32) | Infrastructure. Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. You should not override this version of the FindControl method. (Inherited from Control.) | .gif) | Focus | Sets input focus to the control. (Inherited from HierarchicalDataSourceControl.) | .gif) | GetDesignModeState | Infrastructure. Gets design-time data for a control. (Inherited from Control.) | .gif) | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | .gif) | GetHierarchicalView | Retrieves a single view on the site map data for the SiteMapProvider object according to the starting node and other properties of the data source. (Overrides HierarchicalDataSourceControl..::.GetHierarchicalView(String).) | .gif) | GetList | Retrieves a list of data source controls that can be used as sources of lists of data. | .gif) | GetRouteUrl(Object) | Gets the URL that corresponds to a set of route parameters. (Inherited from Control.) | .gif) | GetRouteUrl(RouteValueDictionary) | Gets the URL that corresponds to a set of route parameters. (Inherited from Control.) | .gif) | GetRouteUrl(String, Object) | Gets the URL that corresponds to a set of route parameters and a route name. (Inherited from Control.) | .gif) | GetRouteUrl(String, RouteValueDictionary) | Gets the URL that corresponds to a set of route parameters and a route name. (Inherited from Control.) | .gif) | GetType | Gets the Type of the current instance. (Inherited from Object.) | .gif) | GetUniqueIDRelativeTo | Returns the prefixed portion of the UniqueID property of the specified control. (Inherited from Control.) | .gif) | GetView | Retrieves a named view on the site map data of the site map provider according to the starting node and other properties of the data source. | .gif) | GetViewNames | Retrieves a collection of named views for the data source control. | .gif) | HasControls | Determines if the server control contains any child controls. (Inherited from HierarchicalDataSourceControl.) | .gif) | HasEvents | Returns a value indicating whether events are registered for the control or any child controls. (Inherited from Control.) | .gif) | IsLiteralContent | Infrastructure. Determines if the server control holds only literal content. (Inherited from Control.) | .gif) | LoadControlState | Restores control-state information from a previous page request that was saved by the SaveControlState method. (Inherited from Control.) | .gif) | LoadViewState | Restores view-state information from a previous page request that was saved by the SaveViewState method. (Inherited from Control.) | .gif) | MapPathSecure | Retrieves the physical path that a virtual path, either absolute or relative, maps to. (Inherited from Control.) | .gif) | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | .gif) | OnBubbleEvent | Determines whether the event for the server control is passed up the page's UI server control hierarchy. (Inherited from Control.) | .gif) | OnDataBinding | Raises the DataBinding event. (Inherited from Control.) | .gif) | OnDataSourceChanged | Raises the DataSourceChanged event. (Inherited from HierarchicalDataSourceControl.) | .gif) | OnInit | Raises the Init event. (Inherited from Control.) | .gif) | OnLoad | Raises the Load event. (Inherited from Control.) | .gif) | OnPreRender | Raises the PreRender event. (Inherited from Control.) | .gif) | OnUnload | Raises the Unload event. (Inherited from Control.) | .gif) | OpenFile | Gets a Stream used to read a file. (Inherited from Control.) | .gif) | RaiseBubbleEvent | Assigns any sources of the event and its information to the control's parent. (Inherited from Control.) | .gif) | RemovedControl | Called after a child control is removed from the Controls collection of the Control object. (Inherited from Control.) | .gif) | Render | Sends server control content to a provided HtmlTextWriter object, which writes the content to be rendered on the client. (Inherited from Control.) | .gif) | RenderChildren | Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client. (Inherited from Control.) | .gif) | RenderControl(HtmlTextWriter) | Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled. (Inherited from HierarchicalDataSourceControl.) | .gif) | RenderControl(HtmlTextWriter, ControlAdapter) | Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object. (Inherited from Control.) | .gif) | ResolveAdapter | Gets the control adapter responsible for rendering the specified control. (Inherited from Control.) | .gif) | ResolveClientUrl | Gets a URL that can be used by the browser. (Inherited from Control.) | .gif) | ResolveUrl | Converts a URL into one that is usable on the requesting client. (Inherited from Control.) | .gif) | SaveControlState | Saves any server control state changes that have occurred since the time the page was posted back to the server. (Inherited from Control.) | .gif) | SaveViewState | Saves any server control view-state changes that have occurred since the time the page was posted back to the server. (Inherited from Control.) | .gif) | SetDesignModeState | Sets design-time data for a control. (Inherited from Control.) | .gif) | SetRenderMethodDelegate | Infrastructure. Assigns an event handler delegate to render the server control and its content into its parent control. (Inherited from Control.) | .gif) | ToString | Returns a string that represents the current object. (Inherited from Object.) | .gif) | TrackViewState | Causes tracking of view-state changes to the server control so they can be stored in the server control's StateBag object. This object is accessible through the Control..::.ViewState property. (Inherited from Control.) | Top

Extension Methods

Explicit Interface Implementations
|
| Name | Description |
|---|
.gif) .gif) | IControlBuilderAccessor..::.ControlBuilder | For a description of this member, see IControlBuilderAccessor..::.ControlBuilder. (Inherited from Control.) | .gif) .gif) | IControlDesignerAccessor..::.GetDesignModeState | For a description of this member, see IControlDesignerAccessor..::.GetDesignModeState. (Inherited from Control.) | .gif) .gif) | IControlDesignerAccessor..::.SetDesignModeState | For a description of this member, see IControlDesignerAccessor..::.SetDesignModeState. (Inherited from Control.) | .gif) .gif) | IControlDesignerAccessor..::.SetOwnerControl | Infrastructure. For a description of this member, see IControlDesignerAccessor..::.SetOwnerControl. (Inherited from Control.) | .gif) .gif) | IControlDesignerAccessor..::.UserData | For a description of this member, see IControlDesignerAccessor..::.UserData. (Inherited from Control.) | .gif) .gif) | IDataBindingsAccessor..::.DataBindings | For a description of this member, see IDataBindingsAccessor..::.DataBindings. (Inherited from Control.) | .gif) .gif) | IDataBindingsAccessor..::.HasDataBindings | For a description of this member, see IDataBindingsAccessor..::.HasDataBindings. (Inherited from Control.) | .gif) .gif) | IDataSource..::.DataSourceChanged | Infrastructure. Occurs when a data source control has changed in some way that affects data-bound controls. | .gif) .gif) | IDataSource..::.GetView | Infrastructure. For a description of this member, see GetView. | .gif) .gif) | IDataSource..::.GetViewNames | Infrastructure. For a description of this member, see GetViewNames. | .gif) .gif) | IExpressionsAccessor..::.Expressions | For a description of this member, see IExpressionsAccessor..::.Expressions. (Inherited from Control.) | .gif) .gif) | IExpressionsAccessor..::.HasExpressions | For a description of this member, see IExpressionsAccessor..::.HasExpressions. (Inherited from Control.) | .gif) .gif) | IHierarchicalDataSource..::.DataSourceChanged | Infrastructure. Occurs when the HierarchicalDataSourceControl has changed in some way that affects data-bound controls. (Inherited from HierarchicalDataSourceControl.) | .gif) .gif) | IHierarchicalDataSource..::.GetHierarchicalView | Infrastructure. Gets the view helper object for the IHierarchicalDataSource interface for the specified path. (Inherited from HierarchicalDataSourceControl.) | .gif) .gif) | IListSource..::.ContainsListCollection | Infrastructure. Gets a value that indicates whether the collection is a collection of IList objects. | .gif) .gif) | IListSource..::.GetList | Infrastructure. For a description of this member, see GetList. | .gif) .gif) | IParserAccessor..::.AddParsedSubObject | For a description of this member, see IParserAccessor..::.AddParsedSubObject. (Inherited from Control.) | Top

Remarks
In this topic: IntroductionThe 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. Specifying the Starting NodeThe SiteMapDataSource binds to site map data and presents its view based on a specified starting node in the site map hierarchy. By default, it is the root node of the hierarchy but it can also be any node within the hierarchy. The starting node is identified by the values of several SiteMapDataSource properties as follows: If the StartingNodeOffset property is set to a value other than 0, it affects the starting node and with it the site map data hierarchy that is exposed by the SiteMapDataSource control. The negative or positive integer value of the StartingNodeOffset identifies the number of levels up or down the site map hierarchy from the starting node that is identified by the StartFromCurrentNode and StartingNodeUrl properties to offset the starting node of the subtree that is exposed by data source control. If the StartingNodeOffset property is set to a negative number -n, the starting node of the subtree that is exposed by the data source control is the ancestor node n hierarchical levels above the identified starting node. If the value n is greater than the number of ancestor levels in the hierarchical tree, the starting node of the subtree is the root node of the site map hierarchy. If the StartingNodeOffset property is set to a positive number +n, the starting node of the subtree that is exposed is a child node n levels below the identified starting node. Because more than one branch of child nodes might exist in the hierarchy, the SiteMapDataSource attempts to resolve a child node directly on the path between the identified starting node and the node that represents the currently requested page, if possible. If the node that represents the currently requested page is not in the subtree of the identified starting node, the value of the StartingNodeOffset property is ignored. If the node that represents the currently requested page is less than n levels below the identified starting node, the currently requested page node is used as the starting node. Retrieving Site Map DataSite map data is retrieved from an SiteMapProvider object, such as XmlSiteMapProvider, which is the default site map provider for ASP.NET. You can specify any provider that is configured for your site to provide the site map data to the SiteMapDataSource and can obtain the list of available providers by accessing the SiteMap..::.Providers collection. Like all data source controls, every instance of a SiteMapDataSource is associated with a single helper object, known as a data source view. The SiteMapDataSourceView is a view on the site map data, according to the properties of the data source, and is retrieved by calling the GetHierarchicalView method. The SiteMapDataSourceView maintains the SiteMapNodeCollection object that the controls bind to. By default, the starting node is the root node of the hierarchy, but you can set the starting node to any node. The starting point can be a node that is relative to the current position in the site map or to an absolute position. You can specify the starting node by setting the StartingNodeUrl property. The SiteMapDataSource is specialized for navigation data, and does not support common data source operations such as sorting, filtering, paging, caching, or data record operations such as updates, insertions or deletions. 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"
/>

Examples
The following code 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.
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:SiteMapDataSource
id="SiteMapDataSource1"
runat="server" />
<asp:TreeView
id="TreeView1"
runat="server"
DataSourceID="SiteMapDataSource1">
</asp:TreeView>
</form>
</body>
</html>
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:SiteMapDataSource
id="SiteMapDataSource1"
runat="server" />
<asp:TreeView
id="TreeView1"
runat="server"
DataSourceID="SiteMapDataSource1">
</asp:TreeView>
</form>
</body>
</html>

Version Information
.NET FrameworkSupported in: 4, 3.5, 3.0, 2.0

Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Thread Safety
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also
|
Bibliothèque de classes .NET Framework SiteMapDataSource, classe Fournit un contrôle de source de données que les contrôles serveur Web et d'autres contrôles peuvent utiliser pour se lier aux données de plan de site hiérarchiques.

Hiérarchie d'héritage
Espace de noms :
System.Web.UI.WebControls
Assembly :
System.Web (dans System.Web.dll)

Syntaxe
<ToolboxBitmapAttribute(GetType(SiteMapDataSource))> _
Public Class SiteMapDataSource _
Inherits HierarchicalDataSourceControl _
Implements IDataSource, IListSource
[ToolboxBitmapAttribute(typeof(SiteMapDataSource))]
public class SiteMapDataSource : HierarchicalDataSourceControl,
IDataSource, IListSource
[ToolboxBitmapAttribute(typeof(SiteMapDataSource))]
public ref class SiteMapDataSource : public HierarchicalDataSourceControl,
IDataSource, IListSource
[<ToolboxBitmapAttribute(typeof(SiteMapDataSource))>]
type SiteMapDataSource =
class
inherit HierarchicalDataSourceControl
interface IDataSource
interface IListSource
end
<asp:SiteMapDataSource />
Le type SiteMapDataSource expose les membres suivants.

Constructeurs

Méthodes
|
| Nom | Description |
|---|
.gif) | AddedControl | Appelée après l'ajout d'un contrôle enfant à la collection Controls de l'objet Control. (Hérité de Control.) | .gif) | AddParsedSubObject | Avertit le contrôle serveur qu'un élément XML ou HTML a été analysé et l'ajoute à l'objet ControlCollection du contrôle serveur. (Hérité de Control.) | .gif) | ApplyStyleSheetSkin | Applique les propriétés de style qui sont définies dans la feuille de style de la page au contrôle. (Hérité de HierarchicalDataSourceControl.) | .gif) | BuildProfileTree | Infrastructure. Collecte des informations sur le contrôle serveur et les livre à la propriété Trace à afficher lorsque le traçage est activé pour la page. (Hérité de Control.) | .gif) | ClearCachedClientID | Infrastructure. Affecte à la valeur ClientID mise en cache la valeur nullNothingnullptrune référence null (Nothing en Visual Basic). (Hérité de Control.) | .gif) | ClearChildControlState | Supprime les informations sur l'état du contrôle des contrôles enfants du contrôle serveur. (Hérité de Control.) | .gif) | ClearChildState | Supprime les informations sur l'état d'affichage et sur l'état du contrôle de tous les contrôles enfants du contrôle serveur. (Hérité de Control.) | .gif) | ClearChildViewState | Supprime les informations d'état d'affichage de tous les contrôles enfants du contrôle serveur. (Hérité de Control.) | .gif) | ClearEffectiveClientIDMode | Infrastructure. Affecte la valeur Inherit à la propriété ClientIDMode de l'instance de contrôle actuelle et de tous contrôles enfants. (Hérité de Control.) | .gif) | CreateChildControls | Appelé par l'infrastructure de page ASP.NET pour avertir les contrôles serveur qui utilisent une implémentation basée sur la composition qu'ils doivent créer tous les contrôles enfants qu'ils contiennent en préparation de la publication ou du rendu. (Hérité de Control.) | .gif) | CreateControlCollection | Crée un nouvel objet ControlCollection pour contenir les contrôles enfants (littéraux et serveur) du contrôle serveur. (Hérité de HierarchicalDataSourceControl.) | .gif) | DataBind()()() | Lie une source de données au contrôle serveur appelé et à tous ses contrôles enfants. (Hérité de Control.) | .gif) | DataBind(Boolean) | Lie une source de données au contrôle serveur appelé et tous ses contrôles enfants avec une option pour déclencher l'événement DataBinding. (Hérité de Control.) | .gif) | DataBindChildren | Lie une source de données aux contrôles enfants du contrôle serveur. (Hérité de Control.) | .gif) | Dispose | Permet à un contrôle serveur d'effectuer le nettoyage final avant qu'il soit libéré de la mémoire. (Hérité de Control.) | .gif) | EnsureChildControls | Détermine si le contrôle serveur contient des contrôles enfants. S'il ne contient pas de contrôles enfants, il en crée. (Hérité de Control.) | .gif) | EnsureID | Crée un identificateur pour les contrôles auxquels aucun identificateur n'est assigné. (Hérité de Control.) | .gif) | Equals(Object) | Détermine si l'Object spécifié est égal à l'Object en cours. (Hérité de Object.) | .gif) | Finalize | Autorise un objet à tenter de libérer des ressources et d'exécuter d'autres opérations de netto***ge avant qu'il ne soit récupéré par l'opération garbage collection. (Hérité de Object.) | .gif) | FindControl(String) | Recherche un contrôle serveur possédant le paramètre id spécifié dans le conteneur d'attribution de noms actuel. (Hérité de HierarchicalDataSourceControl.) | .gif) | FindControl(String, Int32) | Infrastructure. Recherche le conteneur d'attribution de noms actuel d'un contrôle serveur avec l'id spécifié et un entier, spécifié dans le paramètre pathOffset, qui facilite la recherche. Vous ne devez pas substituer cette version de la méthode FindControl. (Hérité de Control.) | .gif) | Focus | Définit le focus d'entrée sur le contrôle. (Hérité de HierarchicalDataSourceControl.) | .gif) | GetDesignModeState | Infrastructure. Obtient les données au moment du design pour un contrôle. (Hérité de Control.) | .gif) | GetHashCode | Sert de fonction de hachage pour un type particulier. (Hérité de Object.) | .gif) | GetHierarchicalView | Récupère une vue unique des données de plan de site pour l'objet SiteMapProvider en fonction du nœud de démarrage et d'autres propriétés de la source de données. (Substitue HierarchicalDataSourceControl..::.GetHierarchicalView(String).) | .gif) | GetList | Récupère la liste des contrôles de source de données qui peuvent être utilisés comme sources de listes de données. | .gif) | GetRouteUrl(Object) | Obtient l'URL qui correspond à un jeu de paramètres d'itinéraire. (Hérité de Control.) | .gif) | GetRouteUrl(RouteValueDictionary) | Obtient l'URL qui correspond à un jeu de paramètres d'itinéraire. (Hérité de Control.) | .gif) | GetRouteUrl(String, Object) | Obtient l'URL qui correspond à un jeu de paramètres d'itinéraire et à un nom d'itinéraire. (Hérité de Control.) | .gif) | GetRouteUrl(String, RouteValueDictionary) | Obtient l'URL qui correspond à un jeu de paramètres d'itinéraire et à un nom d'itinéraire. (Hérité de Control.) | .gif) | GetType | Obtient le Type de l'instance actuelle. (Hérité de Object.) | .gif) | GetUniqueIDRelativeTo | Retourne la partie préfixée de la propriété UniqueID du contrôle spécifié. (Hérité de Control.) | .gif) | GetView | Récupère une vue nommée des données de plan de site du fournisseur de plan de site en fonction du nœud de démarrage et d'autres propriétés de la source de données. | .gif) | GetViewNames | Récupère une collection de vues nommées pour le contrôle de source de données. | .gif) | HasControls | Détermine si le contrôle serveur contient des contrôles enfants. (Hérité de HierarchicalDataSourceControl.) | .gif) | HasEvents | Retourne une valeur indiquant si des événements sont inscrits pour le contrôle ou des contrôles enfants. (Hérité de Control.) | .gif) | IsLiteralContent | Infrastructure. Détermine si le contrôle serveur ne détient qu'un contenu littéral. (Hérité de Control.) | .gif) | LoadControlState | Restaure des informations sur l'état du contrôle à partir d'une demande de page antérieure enregistrée par la méthode SaveControlState. (Hérité de Control.) | .gif) | LoadViewState | Restaure les informations d'état d'affichage à partir d'une demande de page antérieure enregistrée par la méthode SaveViewState. (Hérité de Control.) | .gif) | MapPathSecure | Récupère le chemin d'accès physique auquel un chemin d'accès virtuel, absolu ou relatif, correspond. (Hérité de Control.) | .gif) | MemberwiseClone | Crée une copie superficielle de l'objet Object actif. (Hérité de Object.) | .gif) | OnBubbleEvent | Détermine si l'événement pour le contrôle serveur est passé dans la hiérarchie des contrôles serveur de l'interface utilisateur de la page. (Hérité de Control.) | .gif) | OnDataBinding | Déclenche l'événement DataBinding. (Hérité de Control.) | .gif) | OnDataSourceChanged | Déclenche l'événement DataSourceChanged. (Hérité de HierarchicalDataSourceControl.) | .gif) | OnInit | Déclenche l'événement Init. (Hérité de Control.) | .gif) | OnLoad | Déclenche l'événement Load. (Hérité de Control.) | .gif) | OnPreRender | Déclenche l'événement PreRender. (Hérité de Control.) | .gif) | OnUnload | Déclenche l'événement Unload. (Hérité de Control.) | .gif) | OpenFile | Obtient un Stream utilisé pour lire un fichier. (Hérité de Control.) | .gif) | RaiseBubbleEvent | Assigne les sources éventuelles de l'événement et ses informations au parent du contrôle. (Hérité de Control.) | .gif) | RemovedControl | Appelée après la suppression d'un contrôle enfant dans la collection Controls de l'objet Control. (Hérité de Control.) | .gif) | Render | Envoie le contenu du contrôle serveur à un objet HtmlTextWriter fourni, qui écrit le contenu à rendre sur le client. (Hérité de Control.) | .gif) | RenderChildren | Renvoie le contenu des enfants d'un contrôle serveur dans un objet HtmlTextWriter fourni, qui écrit le contenu à rendre sur le client. (Hérité de Control.) | .gif) | RenderControl(HtmlTextWriter) | Renvoie le contenu du contrôle serveur dans un objet HtmlTextWriter fourni et stocke des informations de traçage au sujet du contrôle si le traçage est activé. (Hérité de HierarchicalDataSourceControl.) | .gif) | RenderControl(HtmlTextWriter, ControlAdapter) | Génère le contenu du contrôle serveur dans un objet HtmlTextWriter à l'aide d'un objet ControlAdapter fourni. (Hérité de Control.) | .gif) | ResolveAdapter | Obtient l'adaptateur de contrôles responsable du rendu du contrôle spécifié. (Hérité de Control.) | .gif) | ResolveClientUrl | Obtient une URL qui peut être utilisée par le navigateur. (Hérité de Control.) | .gif) | ResolveUrl | Convertit une URL en une URL que le client soit en mesure d'utiliser. (Hérité de Control.) | .gif) | SaveControlState | Enregistre les modifications éventuellement apportées à l'état du contrôle serveur depuis la publication de la page sur le serveur. (Hérité de Control.) | .gif) | SaveViewState | Enregistre les modifications éventuellement apportées à l'état d'affichage du contrôle serveur depuis la publication de la page sur le serveur. (Hérité de Control.) | .gif) | SetDesignModeState | Définit les données au moment du design pour un contrôle. (Hérité de Control.) | .gif) | SetRenderMethodDelegate | Infrastructure. Assigne un délégué de gestionnaires d'événements pour générer le rendu du contrôle serveur et de son contenu dans son contrôle parent. (Hérité de Control.) | .gif) | ToString | Retourne une chaîne qui représente l'objet actuel. (Hérité de Object.) | .gif) | TrackViewState | Provoque le suivi des modifications de l'état d'affichage pour le contrôle serveur afin qu'elles puissent être stockées dans l'objet StateBag du contrôle serveur. Cet objet est accessible via la propriété Control..::.ViewState. (Hérité de Control.) | Début

Méthodes d'extension

Implémentations d'interface explicite
|
| Nom | Description |
|---|
.gif) .gif) | IControlBuilderAccessor..::.ControlBuilder | Pour obtenir une description de ce membre, consultez IControlBuilderAccessor..::.ControlBuilder. (Hérité de Control.) | .gif) .gif) | IControlDesignerAccessor..::.GetDesignModeState | Pour obtenir une description de ce membre, consultez IControlDesignerAccessor..::.GetDesignModeState. (Hérité de Control.) | .gif) .gif) | IControlDesignerAccessor..::.SetDesignModeState | Pour obtenir une description de ce membre, consultez IControlDesignerAccessor..::.SetDesignModeState. (Hérité de Control.) | .gif) .gif) | IControlDesignerAccessor..::.SetOwnerControl | Infrastructure. Pour obtenir une description de ce membre, consultez IControlDesignerAccessor..::.SetOwnerControl. (Hérité de Control.) | .gif) .gif) | IControlDesignerAccessor..::.UserData | Pour obtenir une description de ce membre, consultez IControlDesignerAccessor..::.UserData. (Hérité de Control.) | .gif) .gif) | IDataBindingsAccessor..::.DataBindings | Pour obtenir une description de ce membre, consultez IDataBindingsAccessor..::.DataBindings. (Hérité de Control.) | .gif) .gif) | IDataBindingsAccessor..::.HasDataBindings | Pour obtenir une description de ce membre, consultez IDataBindingsAccessor..::.HasDataBindings. (Hérité de Control.) | .gif) .gif) | IDataSource..::.DataSourceChanged | Infrastructure. Se produit lorsque la modification d'un contrôle de source de données affecte les contrôles liés aux données. | .gif) .gif) | IDataSource..::.GetView | Infrastructure. Pour une description de ce membre, consultez GetView. | .gif) .gif) | IDataSource..::.GetViewNames | Infrastructure. Pour obtenir une description de ce membre, consultez GetViewNames. | .gif) .gif) | IExpressionsAccessor..::.Expressions | Pour obtenir une description de ce membre, consultez IExpressionsAccessor..::.Expressions. (Hérité de Control.) | .gif) .gif) | IExpressionsAccessor..::.HasExpressions | Pour obtenir une description de ce membre, consultez IExpressionsAccessor..::.HasExpressions. (Hérité de Control.) | .gif) .gif) | IHierarchicalDataSource..::.DataSourceChanged | Infrastructure. Se produit lorsque HierarchicalDataSourceControl a changé d'une façon qui affecte les contrôles liés aux données. (Hérité de HierarchicalDataSourceControl.) | .gif) .gif) | IHierarchicalDataSource..::.GetHierarchicalView | Infrastructure. Obtient l'objet d'assistance à l'affichage de l'interface IHierarchicalDataSource pour le chemin d'accès spécifié. (Hérité de HierarchicalDataSourceControl.) | .gif) .gif) | IListSource..::.ContainsListCollection | Infrastructure. Obtient une valeur qui indique si la collection est une collection d'objets IList. | .gif) .gif) | IListSource..::.GetList | Infrastructure. Pour une description de ce membre, consultez GetList. | .gif) .gif) | IParserAccessor..::.AddParsedSubObject | Pour obtenir une description de ce membre, consultez IParserAccessor..::.AddParsedSubObject. (Hérité de Control.) | Début

Notes
Dans cette rubrique : IntroductionLe contrôle SiteMapDataSource est une source de données pour les données de plan de site stockées par les fournisseurs de plan de site configurés pour votre site. SiteMapDataSource active les contrôles serveur Web qui ne sont pas spécifiquement des contrôles de navigation de site, tels que les contrôles TreeView, Menu et DropDownList, à lier aux données de plan de site hiérarchiques. Vous pouvez utiliser ces contrôles serveur Web pour afficher un plan de site sous forme de table des matières ou parcourir activement un site. Une autre possibilité consiste à utiliser le contrôle SiteMapPath, qui est conçu spécifiquement comme un contrôle de navigation de site, et qui, par conséquent, n'a pas besoin d'une instance du contrôle SiteMapDataSource. Spécification du nœud initialLe SiteMapDataSource se lie aux données de plan de site et présente sa vue en fonction d'un nœud de démarrage spécifié dans la hiérarchie de plan de site. Par défaut, ce nœud correspond au nœud racine de la hiérarchie, mais il peut également s'agir d'un autre nœud dans la hiérarchie. Le nœud de démarrage est identifié par les valeurs de plusieurs propriétés SiteMapDataSource comme suit : Si la propriété StartingNodeOffset a une valeur autre que 0, elle affecte le nœud de démarrage ainsi que la hiérarchie des données de plan de site qui est exposée par le contrôle SiteMapDataSource. La valeur entière négative ou positive de StartingNodeOffset identifie le nombre de niveaux supérieurs ou inférieurs dans la hiérarchie de plan de site du nœud démarrage qui est identifié par les propriétés StartFromCurrentNode et StartingNodeUrl pour définir un offset du nœud démarrage du sous-arbre qui est exposé par le contrôle de source de données. Si la propriété StartingNodeOffset a la valeur d'un nombre négatif -n, le nœud de démarrage du sous-arbre qui est exposé par le contrôle de source de données est le nœud ancêtre, n niveaux hiérarchiques au-dessus du nœud de démarrage identifié. Si la valeur n est supérieure au nombre de niveaux ancêtres dans l'arborescence hiérarchique, le nœud de démarrage du sous-arbre correspond au nœud racine de la hiérarchie de plan de site. Si la propriété StartingNodeOffset a la valeur d'un nombre positif +n, le nœud de démarrage du sous-arbre qui est exposé est un nœud enfant, n niveaux au-dessous du nœud de démarrage identifié. Étant donné que plusieurs branches de nœuds enfants peuvent exister dans la hiérarchie, SiteMapDataSource essaie de trouver directement un nœud enfant sur le chemin d'accès entre le nœud de démarrage identifié et le nœud qui représente la page actuellement demandée, si possible. Si le nœud qui représente la page actuellement demandée n'est pas présent dans le sous-arbre du nœud de démarrage identifié, la valeur de la propriété StartingNodeOffset est ignorée. Si le nœud qui représente la page actuellement demandée est moins de n niveaux au-dessous du nœud de démarrage identifié, le nœud de la page actuellement demandée est utilisé comme nœud de démarrage. Extraction de données de plan de siteLes données de plan de site sont extraites d'un objet SiteMapProvider, tel que XmlSiteMapProvider, qui est le fournisseur de plan de site par défaut pour ASP.NET. Vous pouvez spécifier n'importe quel fournisseur configuré pour votre site pour fournir les données du plan de site à la SiteMapDataSource et obtenir la liste des fournisseurs disponibles en accédant à la collection SiteMap..::.Providers. Comme tous les contrôles de source de données, chaque instance de SiteMapDataSource est associée à un objet d'assistance unique appelé vue de la source de données. D'après les propriétés de la source de données, SiteMapDataSourceView est une vue des données de plan de site, qui est récupérée en appelant la méthode GetHierarchicalView. SiteMapDataSourceView gère l'objet SiteMapNodeCollection auquel les contrôles sont liés. Par défaut, le nœud de démarrage correspond au nœud racine de la hiérarchie, mais vous pouvez le définir sur un autre nœud. Le point de départ peut être un nœud relatif à la position actuelle dans le plan de site ou à une position absolue. Vous pouvez spécifier le nœud de démarrage en définissant la propriété StartingNodeUrl. SiteMapDataSource est spécialisé pour les données de navigation, et ne prend pas en charge les opérations de source de données courantes, telles que le tri, le filtrage, la pagination ou la mise en cache, ou encore les opérations d'enregistrement de données, telles que les mises à jour, les insertions ou les suppressions. Syntaxe déclarative
<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"
/>

Exemples
L'exemple de code suivant montre comment lier de façon déclarative un contrôle TreeView à un plan de site à l'aide d'un contrôle SiteMapDataSource. Les données de plan de site sont récupérées en commençant au niveau du nœud racine.
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:SiteMapDataSource
id="SiteMapDataSource1"
runat="server" />
<asp:TreeView
id="TreeView1"
runat="server"
DataSourceID="SiteMapDataSource1">
</asp:TreeView>
</form>
</body>
</html>
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:SiteMapDataSource
id="SiteMapDataSource1"
runat="server" />
<asp:TreeView
id="TreeView1"
runat="server"
DataSourceID="SiteMapDataSource1">
</asp:TreeView>
</form>
</body>
</html>

Informations de version
.NET FrameworkPris en charge dans : 4, 3.5, 3.0, 2.0

Plateformes
Windows 7, Windows Vista SP1 ou ultérieur, Windows XP SP3, Windows XP SP2 Édition x64, Windows Server 2008 (installation minimale non prise en charge), Windows Server 2008 R2 (installation minimale prise en charge avec SP1 ou version ultérieure), Windows Server 2003 SP2
Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.

Sécurité des threads
Tous les membres static ( Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.

Voir aussi
RéférenceAutres ressources
|