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

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

SiteMap.RootNode プロパティ

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

サイトナビゲーション構造最上位ページを表す SiteMapNode オブジェクト取得します

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

Public Shared ReadOnly Property
 RootNode As SiteMapNode
Dim value As SiteMapNode

value = SiteMap.RootNode
public static SiteMapNode RootNode { get;
 }
public:
static property SiteMapNode^ RootNode {
    SiteMapNode^ get ();
}
/** @property */
public static SiteMapNode get_RootNode ()
public static function get
 RootNode () : SiteMapNode

プロパティ
サイト ナビゲーション構造最上位ページを表す SiteMapNodeセキュリティ トリミングが有効でノード現在のユーザー返せない場合null 参照 (Visual Basic では Nothing)。

例外例外
例外種類条件

InvalidOperationException

このサイト マップ機能無効になっています。

または

RootNodenull 参照 (Visual Basic では Nothing) に解決されました。これは、セキュリティ トリミングが有効で、ルート ノード現在のユーザー表示されない場合発生します

ConfigurationErrorsException

構成指定されている既定プロバイダ存在しません。

HttpException

この機能は、信頼性が低以上の場合にのみサポートされます。

解説解説
使用例使用例

RootNode プロパティ使用してページ階層における現在の場所に関係なく、サイトルート ノードを表す SiteMapNode オブジェクト取得する方法コード例次に示します

<Script runat="server">

Private Sub Page_Load(sender As
 Object, e As EventArgs)

    ' Examine the CurrentNode, and navigate the SiteMap relative to
 it.
    Response.Write(SiteMap.CurrentNode.Title & "<BR>")
    Response.Write("<FONT COLOR='red'>" & SiteMap.CurrentNode.Url
 & "</FONT><BR>")

    ' What nodes are children of the CurrentNode?
    If (SiteMap.CurrentNode.HasChildNodes) Then
        Dim ChildNodesEnumerator As IEnumerator
 = SiteMap.CurrentNode.ChildNodes.GetEnumerator()
        While (ChildNodesEnumerator.MoveNext())
            ' Prints the Title of each node.
            Response.Write(ChildNodesEnumerator.Current.ToString() & "<BR>")
        End While
    End If
    Response.Write("<HR>")

    ' Examine the RootNode, and navigate the SiteMap relative to it.
    Response.Write(SiteMap.RootNode.Title & "<BR>")
    Response.Write(SiteMap.RootNode.Url & "<BR>")

    ' What nodes are children of the RootNode?
    If (SiteMap.RootNode.HasChildNodes) Then
        Dim RootNodesChildrenEnumerator As
 IEnumerator = SiteMap.RootNode.ChildNodes.GetEnumerator()
        While (RootNodesChildrenEnumerator.MoveNext())
            ' Prints the Title of each node.
            Response.Write(RootNodesChildrenEnumerator.Current.ToString() & "<BR>")
        End While
    End If

End Sub ' Page_Load
</Script>
<Script runat="server">
private void Page_Load(object sender, System.EventArgs
 e)
{
    // Examine the CurrentNode, and navigate the SiteMap relative to
 it.
    Response.Write(SiteMap.CurrentNode.Title + "<BR>");
    Response.Write("<FONT COLOR='red'>" + SiteMap.CurrentNode.Url
 + "</FONT><BR>");

    // What nodes are children of the CurrentNode?
    if (SiteMap.CurrentNode.HasChildNodes) {
        IEnumerator childNodesEnumerator = SiteMap.CurrentNode.ChildNodes.GetEnumerator();
        while (childNodesEnumerator.MoveNext()) {
            // Prints the Title of each node.
            Response.Write(childNodesEnumerator.Current.ToString() + "<BR>");
        }
    }
    Response.Write("<HR>");

    // Examine the RootNode, and navigate the SiteMap relative to it.
    Response.Write(SiteMap.RootNode.Title + "<BR>");
    Response.Write(SiteMap.RootNode.Url + "<BR>");

    // What nodes are children of the RootNode?
    if (SiteMap.RootNode.HasChildNodes) {
        IEnumerator rootNodesChildrenEnumerator = SiteMap.RootNode.ChildNodes.GetEnumerator();
        while (rootNodesChildrenEnumerator.MoveNext()) {
            // Prints the Title of each node.
            Response.Write(rootNodesChildrenEnumerator.Current.ToString() + "<BR>");
        }
    }
}
</Script>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「SiteMap.RootNode プロパティ」の関連用語

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

   

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



SiteMap.RootNode プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS