SiteMapDataSource.StartingNodeUrl Propiedad

Definición

Obtiene o establece un nodo del mapa del sitio que el origen de datos utiliza a continuación como punto de referencia para recuperar nodos de un mapa jerárquico del sitio.

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

Valor de propiedad

Dirección URL de un nodo del mapa del sitio. El control SiteMapDataSource recupera el nodo SiteMapNode identificado y todos sus nodos secundarios del mapa del sitio. El valor predeterminado es Empty.

Ejemplos

En el ejemplo de código siguiente se muestra cómo establecer mediante declaración la StartingNodeUrl propiedad y enlazar un TreeView control a un SiteMapDataSource control.

<%@ 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>

Comentarios

La SiteMapDataSource propiedad se enlaza a los datos del mapa del sitio y presenta su vista en función de un nodo de inicio especificado en la jerarquía del mapa del sitio. De forma predeterminada, el nodo inicial es el nodo raíz de la jerarquía, pero puede establecer el nodo inicial en cualquier nodo con la StartingNodeUrl propiedad o establecer la StartFromCurrentNode propiedad trueen .

El valor de la StartingNodeUrl propiedad se almacena en estado de vista.

Se aplica a

Consulte también