SiteMapResolveEventArgs クラス
メモ : このクラスは、.NET Framework version 2.0 で新しく追加されたものです。
SiteMapProvider クラスの CurrentNode プロパティを呼び出すことによって発生するイベントに関するデータを提供します。
名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文

SiteMapResolveEventArgs クラスを ResolveSiteMapNode メソッドで使用すると、SiteMapResolve イベントのサブスクライバで SiteMapNode クラスのインスタンスを返すことができます。SiteMapResolve イベントを処理するイベント ハンドラ デリゲートを追加することによって、カスタム サイト マップ プロバイダを実装しなくてもページの SiteMapNode 表現を作成できます。

SiteMapResolve イベントを ASP.NET Web ページで処理して、SiteMapPath コントロールなどのサイト ナビゲーション コントロールにより表示される URL を変更する方法を示すコード例を次に示します。この例では、現在のページはオンラインの掲示板またはフォーラムの投稿ページです。より意味のあるサイト ナビゲーションを実現するため、ナビゲーション コントロールにより表示されるノードの URL が、コンテキストに関連するクエリ文字列に付加されます。
メモ CurrentNode プロパティに SiteMapResolveEventHandler クラスの中からアクセスしても安全です。この場合、ASP.NET サイト ナビゲーション インフラストラクチャが無限の再帰を防ぎます。
Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) ' The ExpandForumPaths method is called to handle ' the SiteMapResolve event. AddHandler SiteMap.SiteMapResolve, AddressOf Me.ExpandForumPaths End Sub Private Function ExpandForumPaths(ByVal sender As Object, ByVal e As SiteMapResolveEventArgs) As SiteMapNode ' The current node represents a Post page in a bulletin board forum. ' Clone the current node and all of its relevant parents. This ' returns a site map node that a developer can then ' walk, modifying each node.Url property in turn. ' Since the cloned nodes are separate from the underlying ' site navigation structure, the fixups that are made do not ' effect the overall site navigation structure. Dim currentNode As SiteMapNode = SiteMap.CurrentNode.Clone(True) Dim tempNode As SiteMapNode = currentNode ' Obtain the recent IDs. Dim forumGroupID As Integer = GetMostRecentForumGroupID() Dim forumID As Integer = GetMostRecentForumID(forumGroupID) Dim postID As Integer = GetMostRecentPostID(forumID) ' The current node, and its parents, can be modified to include ' dynamic querystring information relevant to the currently ' executing request. If Not (0 = postID) Then tempNode.Url = tempNode.Url & "?PostID=" & postID.ToString() End If tempNode = tempNode.ParentNode If Not (0 = forumID) And Not (tempNode Is Nothing) Then tempNode.Url = tempNode.Url & "?ForumID=" & forumID.ToString() End If tempNode = tempNode.ParentNode If Not (0 = ForumGroupID) And Not (tempNode Is Nothing) Then tempNode.Url = tempNode.Url & "?ForumGroupID=" & forumGroupID.ToString() End If Return currentNode End Function
private void Page_Load(object sender, EventArgs e) { // The ExpandForumPaths method is called to handle // the SiteMapResolve event. SiteMap.SiteMapResolve += new SiteMapResolveEventHandler(this.ExpandForumPaths); } private SiteMapNode ExpandForumPaths(Object sender, SiteMapResolveEventArgs e) { // The current node represents a Post page in a bulletin board forum. // Clone the current node and all of its relevant parents. This // returns a site map node that a developer can then // walk, modifying each node.Url property in turn. // Since the cloned nodes are separate from the underlying // site navigation structure, the fixups that are made do not // effect the overall site navigation structure. SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true); SiteMapNode tempNode = currentNode; // Obtain the recent IDs. int forumGroupID = GetMostRecentForumGroupID(); int forumID = GetMostRecentForumID(forumGroupID); int postID = GetMostRecentPostID(forumID); // The current node, and its parents, can be modified to include // dynamic querystring information relevant to the currently // executing request. if (0 != postID) { tempNode.Url = tempNode.Url + "?PostID=" + postID.ToString(); } if ((null != (tempNode = tempNode.ParentNode)) && (0 != forumID)) { tempNode.Url = tempNode.Url + "?ForumID=" + forumID.ToString(); } if ((null != (tempNode = tempNode.ParentNode)) && (0 != forumGroupID)) { tempNode.Url = tempNode.Url + "?ForumGroupID=" + forumGroupID.ToString(); } return currentNode; }


System.EventArgs
System.Web.SiteMapResolveEventArgs


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SiteMapResolveEventArgs コンストラクタ
メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。
指定した HttpContext オブジェクトと SiteMapProvider オブジェクトを使用して、SiteMapResolveEventArgs クラスの新しいインスタンスを初期化します。
名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文
Dim context As HttpContext Dim provider As SiteMapProvider Dim instance As New SiteMapResolveEventArgs(context, provider)

context パラメータと provider パラメータが両方とも null 参照 (Visual Basic では Nothing) でもかまいません。
XmlSiteMapProvider オブジェクトは、SiteMapResolveEventArgs クラスの新しいインスタンスを null 参照 (Visual Basic では Nothing) ではない値で初期化します。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SiteMapResolveEventArgs プロパティ
名前 | 説明 | |
---|---|---|
![]() | Context | 要求されたノードが表すページ要求のコンテキストを取得します。 |
![]() | Provider | SiteMapResolve イベントを発生させる SiteMapProvider オブジェクトを取得します。 |

関連項目
SiteMapResolveEventArgs クラスSystem.Web 名前空間
SiteMapResolveEventHandler
SiteMap.SiteMapResolve イベント
SiteMapResolveEventArgs メソッド
名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

関連項目
SiteMapResolveEventArgs クラスSystem.Web 名前空間
SiteMapResolveEventHandler
SiteMap.SiteMapResolve イベント
SiteMapResolveEventArgs メンバ
SiteMapProvider クラスの CurrentNode プロパティを呼び出すことによって発生するイベントに関するデータを提供します。
SiteMapResolveEventArgs データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | SiteMapResolveEventArgs | 指定した HttpContext オブジェクトと SiteMapProvider オブジェクトを使用して、SiteMapResolveEventArgs クラスの新しいインスタンスを初期化します。 |

名前 | 説明 | |
---|---|---|
![]() | Context | 要求されたノードが表すページ要求のコンテキストを取得します。 |
![]() | Provider | SiteMapResolve イベントを発生させる SiteMapProvider オブジェクトを取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

関連項目
SiteMapResolveEventArgs クラスSystem.Web 名前空間
SiteMapResolveEventHandler
SiteMap.SiteMapResolve イベント
- SiteMapResolveEventArgsのページへのリンク