Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 January 12th, 2014, 03:04 PM
Authorized User
 
Join Date: Jan 2014
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
Default Problem with horizontal navigation menu in Chapter 7

I have a quick question about the site map path control. I noticed that when I click on "Home", it shows up as

Home > Home

Is there any way to stop that? Seems redundant.

Last edited by techiegeekster40; January 12th, 2014 at 03:57 PM.. Reason: Changed my question.
 
Old January 12th, 2014, 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

Hi there,

Did you forget to set ShowStartingNode="False" ?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 12th, 2014, 05:14 PM
Authorized User
 
Join Date: Jan 2014
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Hi there,

Did you forget to set ShowStartingNode="False" ?

Imar
From the original question I asked, yes that was the mistake I made. I fixed that and the asp:TreeView and asp:Menu controls now work as they should.

The asp:SiteMapPath control doesn't appear to even have an option to add DataSourceID="SiteMapDataSource1", yet it seems to be using it. To test a theory, I changed the title of the second link to "~Default.aspx" from "Home" to "Planet Wrox" so now in the top nav bar I see :

"Planet Wrox, Reviews, About, Login"

When I click on Planet Wrox in the top nav, I see:

"Home > Planet Wrox" instead of "Home > Home"

I went to the live version of the site - it's doing the same thing on the main page for the breadcrumb link below the top nav bar, I see "Home > Home" when I go to http://aspnet4.planetwrox.com/Default.aspx

I guess it's just something that control does. I found some code that's supposed to programmatically hide the root node when the control gets created, but it got rid of "Home" everywhere, so there was no way to use it to get back to the default page. I disabled that.

Just a little oddity I noticed, not really a big deal.
 
Old January 15th, 2014, 08:45 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Just a little oddity I noticed
Yes, I think it's exactly that.

It's caused by the fact that the sitemap requires a single rootnode, instead of multiple nodes for the top level.

Quote:
The asp:SiteMapPath control doesn't appear to even have an option to add DataSourceID="SiteMapDataSource1"
That's correct. It uses a configured provider in the system-wide Web.config. See this article for some more details: http://msdn.microsoft.com/en-us/libr...vs.100%29.aspx

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in assigning css class in each items of navigation menu of web.sitemap file prathoven BOOK: Beginning ASP.NET 4 : in C# and VB 4 July 6th, 2011 08:39 PM
Chapter 7 Menu tool of navigation css style problem lixintong ASP.NET 3.5 Basics 1 July 10th, 2009 05:02 AM
Problem with Menu Control for Navigation Bear2009 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 February 10th, 2009 05:32 PM
Chapter 7: Navigation - Menu Control VeganMan BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 12 April 10th, 2008 08:28 AM
Asp.Net 2 Horizontal Menu Display Problem ivotive ASP.NET 2.0 Professional 1 December 15th, 2006 04:28 AM





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