By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,444 Members | 1,634 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,444 IT Pros & Developers. It's quick & easy.

SiteMapPath Question

P: n/a
Hello,

I am having a little difficulty coming up with a solution for the
following requirement and I was hoping somebody might be able to offer
some help. I need to create a SiteMapPath for a category system that
supports any number of nested categories. Here's what I mean:

Category A
Category B
Category C
Category D
Category E

This information is stored in a single Categories table in my database
and looks like this:

Id ParentId Name
------------------------------------------------------
1 NULL Category A
2 1 Category B
3 2 Category C
4 NULL Category D
5 4 Category E

If the user was on the details page for Category C, the SiteMapPath
should display Home Category A Category B Category C and the user
should be able the backtrack through the nested structure.

I know that I can create a custom SiteMapProvider that can use a
database as its data source, but I am not sure if this is the right
way. Any feedback would be highly appreciated. Thanks!

Aug 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <11**********************@m73g2000cwd.googlegroups .com>,
se************@gmail.com writes
>Hello,

I am having a little difficulty coming up with a solution for the
following requirement and I was hoping somebody might be able to offer
some help. I need to create a SiteMapPath for a category system that
supports any number of nested categories. Here's what I mean:

Category A
Category B
Category C
Category D
Category E

This information is stored in a single Categories table in my database
and looks like this:

Id ParentId Name
------------------------------------------------------
1 NULL Category A
2 1 Category B
3 2 Category C
4 NULL Category D
5 4 Category E

If the user was on the details page for Category C, the SiteMapPath
should display Home Category A Category B Category C and the user
should be able the backtrack through the nested structure.

I know that I can create a custom SiteMapProvider that can use a
database as its data source, but I am not sure if this is the right
way. Any feedback would be highly appreciated. Thanks!
I did something very similar to this. What I did was that every time the
database was changed, I wrote out a categories.sitemap file (the format
is very simple) and then used a standard sitemappath control in the
..aspx file. Worked a treat and avoided database hits every time.

HTH

--
Alan Silver
(anything added below this line is nothing to do with me)
Aug 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.