SiteMapProvider.CurrentNode プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SiteMapProvider.CurrentNode プロパティの意味・解説 

SiteMapProvider.CurrentNode プロパティ

メモ : このプロパティは、.NET Framework version 2.0 で新しく追加されたものです。

現在要求されているページを表す SiteMapNode オブジェクトを取得します。

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Overridable ReadOnly
 Property CurrentNode As SiteMapNode
Dim instance As SiteMapProvider
Dim value As SiteMapNode

value = instance.CurrentNode
public virtual SiteMapNode CurrentNode { get;
 }
public:
virtual property SiteMapNode^ CurrentNode {
    SiteMapNode^ get ();
}
/** @property */
public SiteMapNode get_CurrentNode ()
public function get CurrentNode
 () : SiteMapNode

プロパティ値
現在要求されているページを表す 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;
  }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SiteMapProvider クラス
SiteMapProvider メンバ
System.Web 名前空間
RootNode
SecurityTrimmingEnabled



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

SiteMapProvider.CurrentNode プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



SiteMapProvider.CurrentNode プロパティのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS