sitemapdatasource

I'm creating a custom menu and I'm trying to retrieve the data from a sitemapdatasource but i can't get te data.

when I do this.
            Dim source As SiteMapDataSource = CType(Me.Parent.FindControl(DataSourceID), SiteMapDataSource)
            Dim list As IList = source.GetList
            For Each item As Object In list
                writer.Write(item.ToString)
            Next

the result is System.Web.UI.ListSourceHelper+ListSourceRow

how can I retrieve the items in the sitemapcontrol, can you please give me a working example
LVL 1
davyquyoAsked:
Who is Participating?
 
DhaestConnect With a Mentor Commented:
Because that a sitemapdatasource  is based on an xml-file, you can read the xml-file into a dataset and loop the dataset.

        Dim dstSiteMap = New System.Data.DataSet
        dstSiteMap.ReadXml(HttpContext.Current.Request.MapPath("web.sitemap"))



For a complexer solution:
Building and Consuming a Dynamic Sitemap in ASP.NET 2.0
http://www.codeproject.com/useritems/DynamicSitemapASPNET2.asp
0
 
davyquyoAuthor Commented:
i'm goiing to repeat my question
i want to create a Custom Menu
not the default one. i want to create one on my own.
0
 
davyquyoAuthor Commented:
its not the sitemap i will create but it wil do i think
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.