SiteMapNodeCollection.Remove メソッド
アセンブリ: System.Web (system.web.dll 内)




Remove メソッドを使用して SiteMapNode オブジェクトを SiteMapNodeCollection コレクションから削除し、Add メソッドを使用して SiteMapNode オブジェクトを SiteMapNodeCollection の末尾に追加する方法を次のコード例に示します。SiteMapNodeCollection が読み取り専用の場合は、NotSupportedException 例外が発生します。
' Move a node from one spot in the list to another. Try Response.Write("Original node order: <BR>") Dim node As SiteMapNode For Each node In nodes Response.Write( node.Title & "<BR>") Next Dim aNode As SiteMapNode = nodes(1) Response.Write("Adding " & aNode.Title & " to the end of the collection.<BR>") nodes.Add(aNode) Response.Write("Removing " & aNode.Title & " at position 1. <BR>") nodes.Remove(nodes(1)) Response.Write("New node order: <BR>") For Each node In nodes Response.Write( node.Title & "<BR>") Next Catch nse As NotSupportedException Response.Write("NotSupportedException caught.<BR>") End Try
// Move a node from one spot in the list to another. try { Response.Write("Original node order: <BR>"); foreach (SiteMapNode node in nodes) { Response.Write( node.Title + "<BR>"); } SiteMapNode aNode = nodes[1]; Response.Write("Adding " + aNode.Title + " to the end of the collection.<BR>"); nodes.Add(aNode); Response.Write("Removing " + aNode.Title + " at position 1. <BR>"); nodes.Remove(nodes[1]); Response.Write("New node order: <BR>"); foreach (SiteMapNode node in nodes) { Response.Write( node.Title + "<BR>"); } } catch (NotSupportedException nse) { Response.Write("NotSupportedException caught.<BR>"); }

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に収録されているすべての辞書からSiteMapNodeCollection.Remove メソッドを検索する場合は、下記のリンクをクリックしてください。

- SiteMapNodeCollection.Remove メソッドのページへのリンク