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

ナビゲーション パス階層におけるノード アイテムの機能的な役割を示す、SiteMapNodeItemType 列挙体のメンバ。


ItemType プロパティを使用して SiteMapNodeItem の型を確認する方法を次のコード例に示します。この例では、InitializeItem メソッドが処理する唯一のノードの型は CurrentNode 型です。このコード例は、SiteMapPath クラスのトピックで取り上げているコード例の一部分です。
' Override the InitializeItem method to add a PathSeparator ' and DropDownList to the current node. Protected Overrides Sub InitializeItem(item As SiteMapNodeItem) ' The only node that must be handled is the CurrentNode. If item.ItemType = SiteMapNodeItemType.Current Then Dim hLink As New HyperLink() ' No Theming for the HyperLink. hLink.EnableTheming = False ' Enable the link of the SiteMapPath is enabled. hLink.Enabled = Me.Enabled ' Set the properties of the HyperLink to ' match those of the corresponding SiteMapNode. hLink.NavigateUrl = item.SiteMapNode.Url hLink.Text = item.SiteMapNode.Title If ShowToolTips Then hLink.ToolTip = item.SiteMapNode.Description End If ' Apply styles or templates to the HyperLink here. ' ... ' ... ' Add the item to the Controls collection. item.Controls.Add(hLink) AddDropDownListAfterCurrentNode(item) Else MyBase.InitializeItem(item) End If End Sub 'InitializeItem
// Override the InitializeItem method to add a PathSeparator // and DropDownList to the current node. protected override void InitializeItem(SiteMapNodeItem item) { // The only node that must be handled is the CurrentNode. if (item.ItemType == SiteMapNodeItemType.Current) { HyperLink hLink = new HyperLink(); // No Theming for the HyperLink. hLink.EnableTheming = false; // Enable the link of the SiteMapPath is enabled. hLink.Enabled = this.Enabled; // Set the properties of the HyperLink to // match those of the corresponding SiteMapNode. hLink.NavigateUrl = item.SiteMapNode.Url; hLink.Text = item.SiteMapNode.Title; if (ShowToolTips) { hLink.ToolTip = item.SiteMapNode.Description; } // Apply styles or templates to the HyperLink here. // ... // ... // Add the item to the Controls collection. item.Controls.Add(hLink); AddDropDownListAfterCurrentNode(item); } else { base.InitializeItem(item); } }
// Override the InitializeItem method to add a PathSeparator // and DropDownList to the current node. protected void InitializeItem(SiteMapNodeItem item) { // The only node that must be handled is the CurrentNode. if (item.get_ItemType().Equals(SiteMapNodeItemType.Current)) { HyperLink hLink = new HyperLink(); // No Theming for the HyperLink. hLink.set_EnableTheming(false); // Enable the link of the SiteMapPath is enabled. hLink.set_Enabled(this.get_Enabled()); // Set the properties of the HyperLink to // match those of the corresponding SiteMapNode. hLink.set_NavigateUrl(item.get_SiteMapNode().get_Url()); hLink.set_Text(item.get_SiteMapNode().get_Title()); if (get_ShowToolTips()) { hLink.set_ToolTip(item.get_SiteMapNode().get_Description()); } // Apply styles or templates to the HyperLink here. // ... // ... // Add the item to the Controls collection. item.get_Controls().Add(hLink); AddDropDownListAfterCurrentNode(item); } else { super.InitializeItem(item); } } //InitializeItem

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


Weblioに収録されているすべての辞書からSiteMapNodeItem.ItemType プロパティを検索する場合は、下記のリンクをクリックしてください。

- SiteMapNodeItem.ItemType プロパティのページへのリンク