 |
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

June 13th, 2005, 01:04 AM
|
Registered User
|
|
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Implementing breadcrumbs with ASP classic
I am looking to add breadcrumb navigation to a website I am currently builing and I have never done this before. What is a quick and easy way to do this; is there a source for such a code?
Thanks,
- Chuksted
|

June 13th, 2005, 08:27 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Does this question have to do with C# or is this dealing with ASP?
As I've seen several meanings of "breadcrumbs", what do you mean by it?
- Peter
|

June 13th, 2005, 01:20 PM
|
Registered User
|
|
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Breadcrumbs as relates to websites simply means a progressive visual history of visited links on a website that helps users navigate back and forth through their favorite pages.
Example: P2P Forum > C > C# > Implementing breadcrumbs with ASP classic; at the top of this page right above the P2P Community Forums Sub heading.
I need to do this in ASP classic. I realise I am in the wrong section of forums but was hoping that someone here might have more experience with ASP classic.
Thanks,
- Chuksted
|

June 13th, 2005, 01:36 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Not to be a stickler for details, but your description is self-contradictory. The indicator at the top of the p2p pages that show you what forum you are in are not what I would call a "progressive visual history" but rather just a location indicator. It tells me where I am, not where I have been. That is why I asked for clarification. Unfortunately it seems most interpretations of "breadcrumb" match the latter half of your description.
I'm not sure if one can give a real specific answer to this question, particularly not knowing what the real intent is (location or history).
In the case of the example on this forum, it's a simple matter of checking parent objects: The "Implementing breadcrumbs with ASP classic" thread belongs to the "C#" forum in the "C" category of the "P2P Forum".
In the case of a true historical breadcrumb, you'd need to store the user's request history in some (semi)persistant data store, then retrieve some number of entries going back as far as you like, then show those requests as some links in the output of the breadcrumb. I'd expect the easiest would be to store some kind of list in the user's session unless you want to persist the data longer than the session itself. Then you could go with a database or similar.
I realize these are rather abstract answers, but to me it is an abstract question.
- Peter
|

June 13th, 2005, 01:41 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
quote:The "Implementing breadcrumbs with ASP classic" thread belongs to the "C#" forum in the "C" category of the "P2P Forum".
|
And even for providing location information, it's a lousy solution, as The "Implementing breadcrumbs with ASP classic" thread belongs to the "ASP Web How-To" forum in the "ASP and ASP.NET" category of the "P2P Forum".
Sorry, couldn't resist. ;)
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Chaos B.C. by Sepultura (Track 13 from the album: Chaos A.D.) What's This?
|

June 13th, 2005, 02:08 PM
|
Registered User
|
|
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
OK guys, so i was wrong for posting under the wrong subject matter. I think I got the solution already from Peter' response; I could simply display a hyperlinked list saved from session variables starting with the first link visited.
Peter was right; I may have been trying to describe location instead of history although one can also ague that all the previously visted links aside from the current page are historical.
- Chuksted
|

June 13th, 2005, 02:14 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I was just kidding.
In a way you're right. But then again, I often open P2P posts directly from my mail client. In that case, I should just see "Implementing breadcrumbs with ASP classic" or even "Reply" instead of the whole trail.
I agree with Peter that a session based solution is probably the easiest to implement. Just persist an array with the last x items. Whenever a new Url is added, dump the last one. Using an ASP include this would be very easy to implement site-wide.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Sleeping With Ghosts by Placebo (Track 4 from the album: Sleeping with Ghosts) What's This?
|

June 14th, 2005, 05:00 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
I have implemented a solution along the lines of what you are suggesting and it was quite awkward.
Session Variables that is.
The solution did work in the end but it was messy when you have a complex hierachy of folders and pages.
Often the location of the page for navigation was less related to the folder/page structure and more related to the site structure.
This may well be due to my poor design but I did try a few ways.
If I was to try this again in classic ASP (Which I wont) I might try to replicate the ASP.NET method and maintain an xml document with your site structure.
Using this structure to somehow see the location of the current page visited within the structure.
And generate the links as with this.
I always hold you opinions in the highest regard Imar and Peter, what do you think to this idea.
This method uses the folder structure: http://roselli.org/adrian/articles/breadcrumbs.asp
as does this: http://www.listology.com/content_sho...ontent_id.5818
But they assume that the directory location is the aim, not the site location.
======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
|

June 14th, 2005, 11:38 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Rod,
If you need to maintain a more explicitly defined site map that doesn't really correspond to a physical directory structure that your site lives in then it would be very logical to maintain some kind of defined structure in something like an XML file. The trick then becomes maintaining that document if/as your site changes.
- Peter
|

June 14th, 2005, 02:48 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
quote:The trick then becomes maintaining that document if/as your site changes.
|
Yeah, that's one of the "problems" with the SiteMap controls in ASP.NET 2.
Basically, they provide a lot of flexibility. You can "move" pages around in the conceptual structure without moving or even touching physical files.
However, you indeed need to manually update the XML file. Not too bad, but it's possible you miss things.
Personally, I'd go with Rod's solution and rebuild the .NET 2 controls in ASP for navigational bread crumps. Shouldn't be too hard....
Imar
|
|
 |