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

Dim instance As SiteMapNode Dim key As String Dim value As String value = instance(key) instance(key) = value
public: virtual property String^ default [String^] { String^ get (String^ key); void set (String^ key, String^ value); }
/** @property */ public String get_Item (String key) /** @property */ public void set_Item (String key, String value)
プロパティ値
key で示されるカスタム属性またはリソース文字列。それ以外の場合は null 参照 (Visual Basic では Nothing)。


Item プロパティは、SiteMapNode オブジェクトを追跡しているプロバイダがローカリゼーションをサポートするかどうかを最初に判断するインデクサです。サポートする場合、Item は
GetImplicitResourceString メソッドを呼び出し、key パラメータを渡します。ローカライズされたテキストが返されなかった場合、Item は
GetExplicitResourceString メソッドを呼び出します。
ローカライズされたテキストが返されなかった場合、またはプロバイダがローカリゼーションをサポートしていない場合、Item は Attributes コレクションの要素を、指定された key を使用して返そうとします。

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


SiteMapNodeItem イベント

名前 | 説明 | |
---|---|---|
![]() | DataBinding | サーバー コントロールがデータ ソースに連結すると発生します。 ( Control から継承されます。) |
![]() | Disposed | サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。 ( Control から継承されます。) |
![]() | Init | サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。 ( Control から継承されます。) |
![]() | Load | サーバー コントロールが Page オブジェクトに読み込まれると発生します。 ( Control から継承されます。) |
![]() | PreRender | Control オブジェクトの読み込み後、表示を開始する前に発生します。 ( Control から継承されます。) |
![]() | Unload | サーバー コントロールがメモリからアンロードされると発生します。 ( Control から継承されます。) |

関連項目
SiteMapNodeItem クラスSystem.Web.UI.WebControls 名前空間
SiteMapPath
SiteMapNode
SiteMapNodeItemType
その他の技術情報
ASP.NET サイト ナビゲーションSiteMapPath Web サーバー コントロールの概要
ASP.NET のサイト ナビゲーションの保護
SiteMapNodeItem クラス
アセンブリ: System.Web (system.web.dll 内)


SiteMapPath コントロールは CompositeControl です。つまり、このコントロールは、数多くの他の Web サーバー コントロールで構成されるユーザー インターフェイスを表示します。SiteMapPath コントロールは、サイト用に構成された SiteMap とその SiteMapNode オブジェクトと直接連携して機能しますが、SiteMapNode オブジェクトは Web サーバー コントロールではありません。SiteMapNodeItem クラスは、SiteMapNode クラスに対する Web サーバー コントロール ラッパーです。これにより、一般的なナビゲーション データ アイテムとユーザー インターフェイス アイテムとの機能的な違いを維持しながら、SiteMapPath コントロールで SiteMapNode のデータを表示できます。
SiteMapPath コントロールは、その Controls コレクションでサイト マップの各ノードを内部的に保持します。SiteMapPath は、その子コントロールを種々のスタイル、テンプレート、および順序で表示できるため、表示の順序とは関係なく、機能的に異なる型のノードを区別できます。こうした理由から、それぞれの SiteMapNodeItem は特定の型を使用して作成されます (指定できる型は、SiteMapNodeItemType 列挙体に記載されています)。
SiteMapNodeItem クラスをコード内で直接使用するのは、SiteMapPath コントロールを拡張する計画や、類似の機能を持つコントロールを記述する計画がある場合だけにしてください。

SiteMapPath から派生したクラスの InitializeItem メソッド内で SiteMapNodeItem オブジェクトの作成および操作を行う方法を次のコード例に示します。このコード例は、SiteMapPath クラスのトピックで取り上げているコード例の一部分です。
Private Sub AddDropDownListAfterCurrentNode(item As SiteMapNodeItem) Dim childNodes As SiteMapNodeCollection = item.SiteMapNode.ChildNodes ' Only do this work if there are child nodes. If Not (childNodes Is Nothing) Then ' Add another PathSeparator after the CurrentNode. Dim finalSeparator As New SiteMapNodeItem(item.ItemIndex, SiteMapNodeItemType.PathSeparator) Dim eventArgs As New SiteMapNodeItemEventArgs(finalSeparator) InitializeItem(finalSeparator) ' Call OnItemCreated every time a SiteMapNodeItem is ' created and initialized. OnItemCreated(eventArgs) ' The pathSeparator does not bind to any SiteMapNode, so ' do not call DataBind on the SiteMapNodeItem. item.Controls.Add(finalSeparator) ' Create a DropDownList and populate it with the children of the ' CurrentNode. There are no styles or templates that are applied ' to the DropDownList control. If OnSelectedIndexChanged is raised , ' the event handler redirects to the page selected. ' The CurrentNode has child nodes. Dim ddList As New DropDownList() ddList.AutoPostBack = True AddHandler ddList.SelectedIndexChanged, AddressOf Me.DropDownNavPathEventHandler ' Add a ListItem to the DropDownList for every node in the ' SiteMapNodes collection. Dim node As SiteMapNode For Each node In childNodes ddList.Items.Add(New ListItem(node.Title, node.Url)) Next node item.Controls.Add(ddList) End If End Sub 'AddDropDownListAfterCurrentNode
private void AddDropDownListAfterCurrentNode(SiteMapNodeItem item) { SiteMapNodeCollection childNodes = item.SiteMapNode.ChildNodes; // Only do this work if there are child nodes. if (childNodes != null) { // Add another PathSeparator after the CurrentNode. SiteMapNodeItem finalSeparator = new SiteMapNodeItem(item.ItemIndex, SiteMapNodeItemType.PathSeparator); SiteMapNodeItemEventArgs eventArgs = new SiteMapNodeItemEventArgs(finalSeparator); InitializeItem(finalSeparator); // Call OnItemCreated every time a SiteMapNodeItem is // created and initialized. OnItemCreated(eventArgs); // The pathSeparator does not bind to any SiteMapNode, so // do not call DataBind on the SiteMapNodeItem. item.Controls.Add(finalSeparator); // Create a DropDownList and populate it with the children of the // CurrentNode. There are no styles or templates that are applied // to the DropDownList control. If OnSelectedIndexChanged is raised, // the event handler redirects to the page selected. // The CurrentNode has child nodes. DropDownList ddList = new DropDownList(); ddList.AutoPostBack = true; ddList.SelectedIndexChanged += new EventHandler(this.DropDownNavPathEventHandler); // Add a ListItem to the DropDownList for every node in the // SiteMapNodes collection. foreach (SiteMapNode node in childNodes) { ddList.Items.Add(new ListItem(node.Title, node.Url)); } item.Controls.Add(ddList); } }
private void AddDropDownListAfterCurrentNode(SiteMapNodeItem item) { SiteMapNodeCollection childNodes = item.get_SiteMapNode(). get_ChildNodes(); // Only do this work if there are child nodes. if (childNodes != null) { // Add another PathSeparator after the CurrentNode. SiteMapNodeItem finalSeparator = new SiteMapNodeItem(item. get_ItemIndex(), SiteMapNodeItemType.PathSeparator); SiteMapNodeItemEventArgs eventArgs = new SiteMapNodeItemEventArgs( finalSeparator); InitializeItem(finalSeparator); // Call OnItemCreated every time a SiteMapNodeItem is // created and initialized. OnItemCreated(eventArgs); // The pathSeparator does not bind to any SiteMapNode, so // do not call DataBind on the SiteMapNodeItem. item.get_Controls().Add(finalSeparator); // Create a DropDownList and populate it with the children of the // CurrentNode. There are no styles or templates that are applied // to the DropDownList control. If OnSelectedIndexChanged is raised, // the event handler redirects to the page selected. // The CurrentNode has child nodes. DropDownList ddList = new DropDownList(); ddList.set_AutoPostBack(true); ddList.add_SelectedIndexChanged(new EventHandler(this. DropDownNavPathEventHandler)); // Add a ListItem to the DropDownList for every node in the // SiteMapNodes collection. for (int iCtr = 0; iCtr < childNodes.get_Count(); iCtr++) { SiteMapNode node = (SiteMapNode)childNodes.get_Item(iCtr); ddList.get_Items().Add(new ListItem(node.get_Title(), node. get_Url())); } item.get_Controls().Add(ddList); } } //AddDropDownListAfterCurrentNode


System.Web.UI.Control
System.Web.UI.WebControls.WebControl
System.Web.UI.WebControls.SiteMapNodeItem


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


SiteMapNodeItem メンバ
System.Web.UI.WebControls 名前空間
SiteMapPath
SiteMapNode
SiteMapNodeItemType
その他の技術情報
ASP.NET サイト ナビゲーション
SiteMapPath Web サーバー コントロールの概要
ASP.NET のサイト ナビゲーションの保護
SiteMapNodeItem コンストラクタ
アセンブリ: System.Web (system.web.dll 内)

Dim itemIndex As Integer Dim itemType As SiteMapNodeItemType Dim instance As New SiteMapNodeItem(itemIndex, itemType)

PathDirection が RootToCurrent の場合、サイト ナビゲーション階層の、より深いレベルにある個々のアイテムを Controls コレクションの末尾に追加できます。しかし、PathDirection プロパティが CurrentToRoot に設定されている場合は、より深いレベルにある各ノードを Controls コレクションの先頭に挿入する必要があります。

SiteMapNodeItem オブジェクトを作成する方法を次のコード例に示します。このコード例は、SiteMapPath クラスのトピックで取り上げているコード例の一部分です。
Private Sub AddDropDownListAfterCurrentNode(item As SiteMapNodeItem) Dim childNodes As SiteMapNodeCollection = item.SiteMapNode.ChildNodes ' Only do this work if there are child nodes. If Not (childNodes Is Nothing) Then ' Add another PathSeparator after the CurrentNode. Dim finalSeparator As New SiteMapNodeItem(item.ItemIndex, SiteMapNodeItemType.PathSeparator) Dim eventArgs As New SiteMapNodeItemEventArgs(finalSeparator) InitializeItem(finalSeparator) ' Call OnItemCreated every time a SiteMapNodeItem is ' created and initialized. OnItemCreated(eventArgs) ' The pathSeparator does not bind to any SiteMapNode, so ' do not call DataBind on the SiteMapNodeItem. item.Controls.Add(finalSeparator) ' Create a DropDownList and populate it with the children of the ' CurrentNode. There are no styles or templates that are applied ' to the DropDownList control. If OnSelectedIndexChanged is raised , ' the event handler redirects to the page selected. ' The CurrentNode has child nodes. Dim ddList As New DropDownList() ddList.AutoPostBack = True AddHandler ddList.SelectedIndexChanged, AddressOf Me.DropDownNavPathEventHandler ' Add a ListItem to the DropDownList for every node in the ' SiteMapNodes collection. Dim node As SiteMapNode For Each node In childNodes ddList.Items.Add(New ListItem(node.Title, node.Url)) Next node item.Controls.Add(ddList) End If End Sub 'AddDropDownListAfterCurrentNode
private void AddDropDownListAfterCurrentNode(SiteMapNodeItem item) { SiteMapNodeCollection childNodes = item.SiteMapNode.ChildNodes; // Only do this work if there are child nodes. if (childNodes != null) { // Add another PathSeparator after the CurrentNode. SiteMapNodeItem finalSeparator = new SiteMapNodeItem(item.ItemIndex, SiteMapNodeItemType.PathSeparator); SiteMapNodeItemEventArgs eventArgs = new SiteMapNodeItemEventArgs(finalSeparator); InitializeItem(finalSeparator); // Call OnItemCreated every time a SiteMapNodeItem is // created and initialized. OnItemCreated(eventArgs); // The pathSeparator does not bind to any SiteMapNode, so // do not call DataBind on the SiteMapNodeItem. item.Controls.Add(finalSeparator); // Create a DropDownList and populate it with the children of the // CurrentNode. There are no styles or templates that are applied // to the DropDownList control. If OnSelectedIndexChanged is raised, // the event handler redirects to the page selected. // The CurrentNode has child nodes. DropDownList ddList = new DropDownList(); ddList.AutoPostBack = true; ddList.SelectedIndexChanged += new EventHandler(this.DropDownNavPathEventHandler); // Add a ListItem to the DropDownList for every node in the // SiteMapNodes collection. foreach (SiteMapNode node in childNodes) { ddList.Items.Add(new ListItem(node.Title, node.Url)); } item.Controls.Add(ddList); } }
private void AddDropDownListAfterCurrentNode(SiteMapNodeItem item) { SiteMapNodeCollection childNodes = item.get_SiteMapNode(). get_ChildNodes(); // Only do this work if there are child nodes. if (childNodes != null) { // Add another PathSeparator after the CurrentNode. SiteMapNodeItem finalSeparator = new SiteMapNodeItem(item. get_ItemIndex(), SiteMapNodeItemType.PathSeparator); SiteMapNodeItemEventArgs eventArgs = new SiteMapNodeItemEventArgs( finalSeparator); InitializeItem(finalSeparator); // Call OnItemCreated every time a SiteMapNodeItem is // created and initialized. OnItemCreated(eventArgs); // The pathSeparator does not bind to any SiteMapNode, so // do not call DataBind on the SiteMapNodeItem. item.get_Controls().Add(finalSeparator); // Create a DropDownList and populate it with the children of the // CurrentNode. There are no styles or templates that are applied // to the DropDownList control. If OnSelectedIndexChanged is raised, // the event handler redirects to the page selected. // The CurrentNode has child nodes. DropDownList ddList = new DropDownList(); ddList.set_AutoPostBack(true); ddList.add_SelectedIndexChanged(new EventHandler(this. DropDownNavPathEventHandler)); // Add a ListItem to the DropDownList for every node in the // SiteMapNodes collection. for (int iCtr = 0; iCtr < childNodes.get_Count(); iCtr++) { SiteMapNode node = (SiteMapNode)childNodes.get_Item(iCtr); ddList.get_Items().Add(new ListItem(node.get_Title(), node. get_Url())); } item.get_Controls().Add(ddList); } } //AddDropDownListAfterCurrentNode

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


SiteMapNodeItem プロパティ



名前 | 説明 | |
---|---|---|
![]() | System.Web.UI.IDataItemContainer.DataItem | このメンバの詳細については、IDataItemContainer.DataItem のトピックを参照してください。 |
![]() | System.Web.UI.IDataItemContainer.DataItemIndex | このメンバの説明については、DataItemIndex のトピックを参照してください。 |
![]() | System.Web.UI.IDataItemContainer.DisplayIndex | このメンバの説明については、System.Web.UI.IDataItemContainer.DisplayIndex のトピックを参照してください。 |

関連項目
SiteMapNodeItem クラスSystem.Web.UI.WebControls 名前空間
SiteMapPath
SiteMapNode
SiteMapNodeItemType
その他の技術情報
ASP.NET サイト ナビゲーションSiteMapPath Web サーバー コントロールの概要
ASP.NET のサイト ナビゲーションの保護
SiteMapNodeItem メソッド



関連項目
SiteMapNodeItem クラスSystem.Web.UI.WebControls 名前空間
SiteMapPath
SiteMapNode
SiteMapNodeItemType
その他の技術情報
ASP.NET サイト ナビゲーションSiteMapPath Web サーバー コントロールの概要
ASP.NET のサイト ナビゲーションの保護
SiteMapNodeItem メンバ
SiteMapNodeItem クラスは、SiteMapPath コントロールによって使用され、機能的に SiteMapNode を表します。
SiteMapNodeItem データ型で公開されるメンバを以下の表に示します。






名前 | 説明 | |
---|---|---|
![]() | DataBinding | サーバー コントロールがデータ ソースに連結すると発生します。(Control から継承されます。) |
![]() | Disposed | サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。(Control から継承されます。) |
![]() | Init | サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。(Control から継承されます。) |
![]() | Load | サーバー コントロールが Page オブジェクトに読み込まれると発生します。(Control から継承されます。) |
![]() | PreRender | Control オブジェクトの読み込み後、表示を開始する前に発生します。(Control から継承されます。) |
![]() | Unload | サーバー コントロールがメモリからアンロードされると発生します。(Control から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Web.UI.IDataItemContainer.DataItem | このメンバの詳細については、IDataItemContainer.DataItem のトピックを参照してください。 |
![]() | System.Web.UI.IDataItemContainer.DataItemIndex | このメンバの説明については、DataItemIndex のトピックを参照してください。 |
![]() | System.Web.UI.IDataItemContainer.DisplayIndex | このメンバの説明については、System.Web.UI.IDataItemContainer.DisplayIndex のトピックを参照してください。 |

関連項目
SiteMapNodeItem クラスSystem.Web.UI.WebControls 名前空間
SiteMapPath
SiteMapNode
SiteMapNodeItemType
その他の技術情報
ASP.NET サイト ナビゲーションSiteMapPath Web サーバー コントロールの概要
ASP.NET のサイト ナビゲーションの保護
- SiteMapNodeItemのページへのリンク