SiteMapProvider.RootNode Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the root SiteMapNode object of the site map data that the current provider represents.
public:
virtual property System::Web::SiteMapNode ^ RootNode { System::Web::SiteMapNode ^ get(); };
public virtual System.Web.SiteMapNode RootNode { get; }
member this.RootNode : System.Web.SiteMapNode
Public Overridable ReadOnly Property RootNode As SiteMapNode
The root SiteMapNode of the current site map data provider. The default implementation performs security trimming on the returned node.
The following code example demonstrates how to implement the RootNode property in a class that implements the abstract SiteMapProvider class.
This code example is part of a larger example provided for the SiteMapProvider class.
// Implement the CurrentNode property.
public override SiteMapNode CurrentNode
{
get
{
string currentUrl = FindCurrentUrl();
// Find the SiteMapNode that represents the current page.
SiteMapNode currentNode = FindSiteMapNode(currentUrl);
return currentNode;
}
}
// Implement the RootNode property.
public override SiteMapNode RootNode
{
get
{
return rootNode;
}
}
' Implement the CurrentNode property.
Public Overrides ReadOnly Property CurrentNode() As SiteMapNode
Get
Dim currentUrl As String = FindCurrentUrl()
' Find the SiteMapNode that represents the current page.
Dim aCurrentNode As SiteMapNode = FindSiteMapNode(currentUrl)
Return aCurrentNode
End Get
End Property
' Implement the RootNode property.
Public Overrides ReadOnly Property RootNode() As SiteMapNode
Get
Return aRootNode
End Get
End Property
The default implementation calls the abstract GetRootNodeCore method.
When overriding the RootNode property in a derived class, be sure that the implementation does not navigate the provider hierarchy, if one exists, to find the absolute root node of the site.
Προϊόν | Εκδόσεις |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET σχόλια
.NET είναι ένα έργο ανοιχτού κώδικα. Επιλέξτε μια σύνδεση για να παρέχετε σχόλια: