• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 545
  • Last Modified:

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
0
davyquyo
Asked:
davyquyo
  • 2
  • 2
1 Solution
 
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
 
DhaestCommented:
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:
its not the sitemap i will create but it wil do i think
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now