Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 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
 
Old February 6th, 2006, 04:09 PM
Authorized User
 
Join Date: Aug 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default SiteMapPath Control Question

I've added a sitemappath control (to use as breadcrumbs) to my own page and it seems to work only when I reference pages in the root of the site. The breadcrumbs don't display when I access a page buried in a sub folder under the root. I can't seem to locate any properties for the sitemappath control to allow subfolders - heck maybe its a setting in the web.sitemap file. Is there a way to get this working?
 
Old February 6th, 2006, 04:41 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Have you added the files in the sub folders to the web.sitemap file? How does that file look like? And are the sub folder files accessible by all users?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 7th, 2006, 08:45 AM
Authorized User
 
Join Date: Aug 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default

example:
Code:
<siteMapNode url="Default.aspx" title="Home"  description="LCS Home Page">
<siteMapNode url="~/Pages/Leaders/Leaders.aspx" title="Leadership"  description="Who's at the helm at LCS">
<siteMapNode url="~/Pages/Leaders/Admins.aspx" title="Administrators"  description="LCS Administrators" />
<siteMapNode url="~/Pages/Leaders/Board.aspx" title="Board"  description="LCS Board of Education" />
</siteMapNode>
</siteMapNode>
The only bit of xml data that shows up in the siteMapPath control is "Home" in the above. Now if I eliminate the folder structure on my web site and place all pages in the root like the following all works well.
Code:
<siteMapNode url="Default.aspx" title="Home"  description="LCS Home Page">
<siteMapNode url="Leaders.aspx" title="Leadership"  description="Who's at the helm at LCS">
<siteMapNode url="Admins.aspx" title="Administrators"  description="LCS Administrators" />
<siteMapNode url="Board.aspx" title="Board"  description="LCS Board of Education" />
</siteMapNode>
</siteMapNode>
Doesn't the siteMapPath control support subfolders? I refuse to believe that it doesn't.
 
Old February 7th, 2006, 03:17 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi lcsgeek,

Yeah, the SiteMap definitely supports sub folders. I had no problem running the sitemap you provided with a few dummy pages.

The only thing I see is that Boards and Admins are nested within Leaders, but that could be by design.

Are you using a special SiteMapProvider? Or did you just drop a SiteMapPath control on a page?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Smalfilm by Spinvis (Track 2 from the album: Spinvis) What's This?
 
Old February 7th, 2006, 06:00 PM
Authorized User
 
Join Date: Aug 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just dropped one on the page - so I guess I'm using out-of-box provider. Can you tell me about providers?
 
Old February 7th, 2006, 06:17 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Custom providers are quite a complex subject (although very interesting) so you may not need them at this point. There's an article at the MSDN site in case you want to know more about it:

http://msdn.microsoft.com/asp.net/do...ustsitemap.asp

Here's what I did to get your sample to work:

1. Created the site map file
2. Create Default.aspx in the root and dropped a SiteMapPath control on the page
3. Created the Pages and Leaders folders and added a Admins and Leaders page
4. Dragged links to these pages on Default.asp
5. Dropped SiteMapPath controls on the two pages in the Leaders folder.
6. Ran the page in my browser. The SiteMapPath control said Home. Clicked one of the links and got Leadership - Administrators.

Isn't this what you're seeing?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: I Think I'm A Mother by P.J. Harvey (Track 8 from the album: To Bring You My Love) What's This?
 
Old February 7th, 2006, 06:18 PM
Authorized User
 
Join Date: Aug 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok here is something. In each of my subfolders I have a default.aspx which gets loaded without referencing the .aspx file name but just the folder name and I reference it in web.sitemap as follows:

Code:
<siteMapNode url="~/Pages/Academics/" title="Academic Information" ......
I think this is where things start to breakdown. I added an Academics.aspx page to the ~/Pages/Academics subfolder and referenced it within the web.sitemap file and the siteMapPath control started working. Not sure why a file name needs to be referenced for the siteMapPath control - I would think that the web.sitemap file would provide enough info as I had it.

I am still interested in the providers you mentioned though.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create SiteMapPath in PHP? firblazer PHP How-To 0 July 14th, 2008 09:33 PM
User control question scott_rider ASP.NET 1.x and 2.0 Application Design 6 May 20th, 2008 03:59 PM
with pages in a subdir sitemappath and treeview d thenoseknows ASP.NET 2.0 Basics 1 June 15th, 2006 11:10 AM
A Web Control Question leaf ASP.NET 2.0 Professional 0 March 22nd, 2006 09:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.