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'm looking into writing a audio syntesizer in Java, and was wondering if anybody
So I'm looking at writing an iPhone application that shows things on a map.
I'm looking into writing an Eclipse plugin for FlexUnit and was wondering where I
My company is looking into writing a custom application that will need to perform
I'm looking at writing a tool for generating code based on the contents of
I'm looking into writing a simple synchronization ability into my app and one of
I'm looking into writing a wxWidget that displays a graphical node network, and therefore
I am looking for good templates for writing both technical and functional specs on
I'm looking to add support for reading and writing video files in my application.
I'm writing a web app that points to external links. I'm looking to create

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.