SiteMapNodeCollection.Remove(SiteMapNode) 方法    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从集合中移除指定的 SiteMapNode 对象。
public:
 virtual void Remove(System::Web::SiteMapNode ^ value);
	public virtual void Remove(System.Web.SiteMapNode value);
	abstract member Remove : System.Web.SiteMapNode -> unit
override this.Remove : System.Web.SiteMapNode -> unit
	Public Overridable Sub Remove (value As SiteMapNode)
	参数
- value
 - SiteMapNode
 
要从 SiteMapNode 移除的 SiteMapNodeCollection。
例外
集合中不存在 value。
              value 为 null。
示例
下面的代码示例演示如何使用 Remove 方法从SiteMapNodeCollection集合中删除 SiteMapNode 对象,然后使用 方法将 SiteMapNode 对象追加到 的SiteMapNodeCollectionAdd末尾。 SiteMapNodeCollection如果 为只读,NotSupportedException则捕获异常。
// 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>");
}
' 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
	注解
可以通过检查 IsReadOnly 属性来测试集合是否SiteMapNodeCollection为只读。
方法 Remove 通过调用 Object.Equals 方法确定相等性。