SiteMapDataSource.StartingNodeUrl Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit un nœud dans la carte de site que la source de données utilise ensuite comme point de référence pour récupérer des nœuds à partir d’une carte de site hiérarchique.
public:
virtual property System::String ^ StartingNodeUrl { System::String ^ get(); void set(System::String ^ value); };
public virtual string StartingNodeUrl { get; set; }
member this.StartingNodeUrl : string with get, set
Public Overridable Property StartingNodeUrl As String
Valeur de propriété
URL d’un nœud dans la carte de site. Récupère SiteMapDataSource les nœuds identifiés SiteMapNode et enfants de la carte de site. La valeur par défaut est un Empty.
Exemples
L’exemple de code suivant montre comment définir de manière déclarative la StartingNodeUrl propriété et lier un TreeView contrôle à un SiteMapDataSource contrôle.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:SiteMapDataSource
id="SiteMapDataSource1"
runat="server"
StartingNodeUrl="WebForm1.aspx">
</asp:SiteMapDataSource>
<asp:TreeView
id="TreeView1"
runat="server"
DataSourceID="SiteMapDataSource1">
</asp:TreeView>
</form>
</body>
</html>
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:SiteMapDataSource
id="SiteMapDataSource1"
runat="server"
StartingNodeUrl="WebForm1.aspx">
</asp:SiteMapDataSource>
<asp:TreeView
id="TreeView1"
runat="server"
DataSourceID="SiteMapDataSource1">
</asp:TreeView>
</form>
</body>
</html>
Remarques
La SiteMapDataSource propriété est liée aux données de carte de site et présente son affichage en fonction d’un nœud de départ spécifié dans la hiérarchie de carte de site. Par défaut, le nœud de départ est le nœud racine de la hiérarchie, mais vous pouvez définir le nœud de départ sur n’importe quel nœud avec la StartingNodeUrl propriété ou définir la StartFromCurrentNode propriété truesur .
La valeur de la StartingNodeUrl propriété est stockée dans l’état d’affichage.