Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 643315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:16:10+00:00 2026-05-13T21:16:10+00:00

I’m working on a CMS using VB.NET 3.5 and I’m stuck on a concept.

  • 0

I’m working on a CMS using VB.NET 3.5 and I’m stuck on a concept. I have different modules that do different things like wysiwyg, contact form, image gallery, etc… but one that is becoming a bit of a challenge is wrapping my head around “how” to build a sitemap.

For the record, I am NOT talking about an SEO Sitemap (XML), but rather a visitor sitemap similar to Karamasoft (Check out the BMW or the Dell style for an idea of what I’m shooting for).

My Database has the following columns

ID        ParentID        MenuName        Slug            DateUpdated

1         Null            Home            ~/home          01/01/2010
2         Null            About           ~/about         01/01/2010
3         Null            Contact         ~/contact       01/01/2010
4         2               History         ~/history       01/01/2010
5         2               Future          ~/future        01/01/2010
6         3               Jobs            ~/jobs          01/01/2010

I have my code setup in such a way that I populate all the relevant fields into an Object on the server side that I can then access multiple times without hitting the DB over and over.

    Public Shared ReadOnly Property Instance() As List(Of NavigationDataItem)
        Get
            Dim n As New List(Of NavigationDataItem)()

            If _Instance Is Nothing Then

                Dim PagesDC As New Dal.icms_PagesDataContext()
                Dim results = PagesDC.icms_Pages_GetPageMenu().ToList

                For Each o As Object In results
                    If o.isHomePage Then
                        n.Add(New NavigationDataItem(o.ID, o.ParentID, o.MenuName, "~/", o.DateUpdated))
                    Else
                        n.Add(New NavigationDataItem(o.ID, o.ParentID, o.MenuName, o.Slug, o.DateUpdated))
                    End If
                Next

                _Instance = n
            Else : n = _Instance
            End If
            Return n
        End Get
    End Property 'Instance

What I’m trying to do is have all of the records that have NO ParentID (IE: they are top level items) be listed at the top, and all of it’s children listed underneath.

<table>
  <tr>
    <th>Home</th>
    <th>About</th>
    <th>Contact</th>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>History</td>
    <td>Jobs</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Future</td>
    <td>&nbsp;</td>
  </tr>
</table>

I want to be able to dynamically set the number of table columns, so that if I have 10 Parent items and only set my width to 5 columns, the remaining parent items would be listed in another table row below.

I’m sure I can build the code myself once I wrap my head around this, I’m just looking for a “concept” on how to approach this problem.

Also, I am NOT looking for a Treeview since that’s basically what I’m doing now and I really don’t love it at all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:16:10+00:00Added an answer on May 13, 2026 at 9:16 pm

    You could use a DataList to set the number of columns and bind that with top level items only. Then use a simple function to get the childitems for each main item and render those with a repeater:

    <asp:DataList RepeatColumns="5" DataSource="<%#GetParentMenuItems()%>" runat="server">
      <ItemTemplate>
        <h1><%#Container.DataItem.MenuName%></h1>
        <hr />
        <asp:Repeater DataSource="<%#GetChildMenuItems(Container.DataItem.ID)%>" runat="server">
          <ItemTemplate>
            <a href="<%#Container.DataItem.Slug%>"><%#Container.DataItem.MenuName%></a>
            <br />
          </ItemTemplate>
        </asp:Repeater>
      </ItemTemplate>
    </asp:DataList>
    

    Ideally, the child items would be a collection hanging off the parent, then you could bind the nested repeater to that directly. You could then create a user control that renders the items, and then nest itself to render any sub-items.

    On a side-note: I think you’ll be doing yourself a favor by sticking to the .NET sitemap rather than cooking up your own. Lots of handy controls are using it, and it’s nicely integrated with the rest of the ASP.NET framework. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.