SiteMap.SiteMapResolve イベントとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SiteMap.SiteMapResolve イベントの意味・解説 

SiteMap.SiteMapResolve イベント

メモ : このイベントは、.NET Framework version 2.0新しく追加されたものです。

CurrentNode プロパティアクセスされると発生します

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

Public Shared Event SiteMapResolve
 As SiteMapResolveEventHandler
Dim handler As SiteMapResolveEventHandler

AddHandler SiteMap.SiteMapResolve, handler
public static event SiteMapResolveEventHandler
 SiteMapResolve
public:
static event SiteMapResolveEventHandler^ SiteMapResolve {
    void add (SiteMapResolveEventHandler^ value);
    void remove (SiteMapResolveEventHandler^ value);
}
/** @event */
public static void add_SiteMapResolve
 (SiteMapResolveEventHandler value)

/** @event */
public static void remove_SiteMapResolve
 (SiteMapResolveEventHandler value)
JScript では、イベント使用できますが、新規に宣言することはできません。
解説解説
使用例使用例

SiteMapResolve イベントASP.NET Web ページ処理して、SiteMapPath コントロールなどのサイト ナビゲーション コントロールにより表示される URL変更する方法を示すコード例次に示します。この例では、現在のページオンライン掲示板またはフォーラム投稿ページです。より意味のあるサイト ナビゲーション実現するため、ナビゲーション コントロールにより表示されるノードURL が、コンテキスト関連するクエリ文字列付加されます。

メモメモ

ASP.NET サイト ナビゲーション インフラストラクチャは、無限再帰防ぎます。これが保護手段となり、CurrentNode プロパティSiteMapResolveEventHandlerclass の中からアクセスすることに関連するセキュリティ リスク最小限抑えます

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;
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SiteMap クラス
SiteMap メンバ
System.Web 名前空間
SiteMapResolveEventHandler
SiteMapResolveEventArgs


このページでは「.NET Framework クラス ライブラリ リファレンス」からSiteMap.SiteMapResolve イベントを検索した結果を表示しています。
Weblioに収録されているすべての辞書からSiteMap.SiteMapResolve イベントを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からSiteMap.SiteMapResolve イベント を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「SiteMap.SiteMapResolve イベント」の関連用語

SiteMap.SiteMapResolve イベントのお隣キーワード
検索ランキング

   

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



SiteMap.SiteMapResolve イベントのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS