SiteMapProvider.CurrentNode プロパティ
アセンブリ: System.Web (system.web.dll 内)

現在要求されているページを表す SiteMapNode。SiteMapNode が見つからなかった場合、または見つかったが現在のユーザーに返すことができない場合は null 参照 (Visual Basic では Nothing)。

SiteMapNode オブジェクトを取得しようとする前に、SiteMapResolve イベントが発生し、イベントのサブスクライバが SiteMapNode クラスのインスタンスを返すことができるようにします。イベントのサブスクライバがない場合、SiteMapProvider クラスは現在の HTTP コンテキストを使用して FindSiteMapNode メソッドを呼び出し、現在要求されているページを表す SiteMapNode を取得します。
現在要求されているページが SiteMapNode に対応していない場合は、null 参照 (Visual Basic では Nothing) が返されます。セキュリティ トリミングが有効で、ユーザーに SiteMapNode へのアクセス許可がない場合は、null 参照 (Visual Basic では Nothing) が返されます。

SiteMapProvider 抽象クラスを実装するクラスに CurrentNode プロパティを実装する方法を次のコード例に示します。
このコード例は、SiteMapProvider クラスのトピックで取り上げているコード例の一部分です。
' 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
// 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; } }

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からSiteMapProvider.CurrentNode プロパティを検索する場合は、下記のリンクをクリックしてください。

- SiteMapProvider.CurrentNode プロパティのページへのリンク