web.sitemap
ASP.NET ページのすべての子ページを一覧表示する Repeater があります。それDataSource
はSiteMapNodeCollection
です。しかし、登録フォームのページをそこに表示したくありません。
Dim Children As SiteMapNodeCollection = SiteMap.CurrentNode.ChildNodes
'remove registration page from collection
For Each n As SiteMapNode In SiteMap.CurrentNode.ChildNodes
If n.Url = "/Registration.aspx" Then
Children.Remove(n)
End If
Next
RepeaterSubordinatePages.DataSource = Children
SiteMapNodeCollection.Remove()
メソッドは
NotSupportedException: 「コレクションは読み取り専用です」。
リピーターを DataBinding する前に、コレクションからノードを削除するにはどうすればよいですか?