I\'ve got a Repeater that lists all the web.sitemap
child pages on an ASP.NET page. Its DataSource
is a SiteMapNodeCollection
. But, I do
I got it to work with code below:
Dim children = From n In SiteMap.CurrentNode.ChildNodes _
Where CType(n, SiteMapNode).Url <> "/Registration.aspx" _
Select n
RepeaterSubordinatePages.DataSource = children
Is there a better way where I don't have to use the CType()
?
Also, this sets children to a System.Collections.Generic.IEnumerable(Of Object)
. Is there a good way to get back something more strongly typed like a System.Collections.Generic.IEnumerable(Of System.Web.SiteMapNode)
or even better a System.Web.SiteMapNodeCollection
?