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

  • SEARCH
  • Home
  • 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 352733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:45:53+00:00 2026-05-12T11:45:53+00:00

I am looking at writing an ecommerce platform just for working practice and a

  • 0

I am looking at writing an ecommerce platform just for working practice and a small project of mine. I am at the stage where i want to start writing the URL’s and SEO friednly URL’s.

My problem is i have wrote the system to have unlimited categories / sub categories and making my navigation is causing me some problems.

my ideal url would be:

http://mydomain.com/products/first-category/second-category/productname.aspx

and in order to achieve this i am thinking about looping back to the database where the parentid=. but i feel this is not going to be best practice and doing this for every category and sub category and product for each page seems wrong.

can anyone help how to achieve this ?

I have knowledge of using http://www.urlrewriting.net and writing the website in asp.net 3.5 but its the technical answer of looping gettings the names etc i need help with.

If you require anymore information i am happy to answer any questions and hope someone can help me achieve this.

Thanks

  • 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-12T11:45:53+00:00Added an answer on May 12, 2026 at 11:45 am

    Just cache the entire table of categories to memory if you’re worried about going back to database.

    struct Category
    {
      UInt32 CategoryId {get;set;}
      UInt32 ParentId {get;set;}
      string Name {get; set;}
      string Url {get; set;}
    }
    
    SELECT CategoryId, ParentId, Name, Url FROM Categories Order By CategoryId;
    
    MyCategories = new Dictionary<UInt32, Category>();
    
    while (rdr.Read)
    {
      MyCategories.Add((UInt32)rdr["category_id"], new Category(........));
    }
    

    Now getting the complete path is just looping in memory

    string path = "";
    currentCategory = MyCategories[category_id];
    
    while (currentCategory != nil)
    {
      // StringBuilder here 
      path += "/" + currentCategory.Name;
      currentCategory = MyCategories[Category.ParentId];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been looking into writing a small cross-platform OpenGL/helper code that can compile on
I was just writing a procedure that is looking for a newline and I
Im looking at writing a application for a web 2.0 start up site which
I am looking into writing web based games using just Javascript, HTML, and CSS.
I'm looking into writing a small custom app for a small business that can
I'm looking to make a custom filesystem for a project I'm working on. Currently
I am looking to start writing a sophisticated application in JavaScript to run on
I am looking into writing a web-based vehicle tracking system. The framework I have
I'm looking at writing a shell extension so when a file is clicked an
I'm looking into writing simple graphics code in Android and I've noticed some synchronized()

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.