Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 28th, 2010, 11:45 AM
Authorized User
 
Join Date: Jan 2010
Posts: 14
Thanks: 4
Thanked 1 Time in 1 Post
Default Menu Controls, ch 7 p245 -

As a matter of general principle I like to add comments to my files.

Working through the Menu Control content in ch 7 I built the web.sitemap file with no problems. Before I continued to insert the Menu control into the MasterPage.Master file I added a few comments.

I then inserted the Menu control and, rather than seeing the example as in figure 7-5, I saw 'Root' instead of 'Home'. This seemed to be inconsistent so I revisited web.sitemap and removed the comments. Once that was done I restarted the Menu control process and this time everything behaved as shown in Fig 7-5.

Being ever curious I wondered why I could not insert a comment into web.sitemap, and experimented with the positioning of the comments.

It may or may not be a measure of my simple mind here, but when the comment was as positioned as follows:

Code:
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

    <!--this is a comment-->

    <siteMapNode url="~/" title="Home" description="Home">
    <siteMapNode url="~/Default.aspx" title="Home" description="Go to the homepage" />
        ...
it forced the 'Root' display as noted above.

However, if the comment was positioned as:

Code:
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

    <siteMapNode url="~/" title="Home" description="Home">

    <!--this is a comment-->
    
    <siteMapNode url="~/Default.aspx" title="Home" description="Go to the homepage" />
        ...
everything behaved as expected.


So, just to clarify my thinking.

Are comments allowed, or not recommended in web.sitemap.

Why is the positioning so critical?

Would it actually matter anyway if the screen showed 'Root' rather then the correct descriptor, or would there be problems further down the line?

Apologies for asking such trivial questions.
__________________
Alan.
 
Old January 29th, 2010, 11:11 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:
Are comments allowed, or not recommended in web.sitemap.
Apparently they are, but not in the root ;-)
Quote:
Why is the positioning so critical?
I am not 100% sure about the actual implementation but it might see the comment as an element as well (which it is) and not see it's not a sitemap node.
Quote:
Would it actually matter anyway if the screen showed 'Root' rather then the correct descriptor, or would there be problems further down the line?
Does it look good at run-time?

I wouldn't worry about documentation sitemaps too much. IMO, they are pretty self describing if you know how they work in general.

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!
The Following User Says Thank You to Imar For This Useful Post:
Alanrf (January 29th, 2010)





Similar Threads
Thread Thread Starter Forum Replies Last Post
CH 15 Context Menu - Element Menu Items Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 November 9th, 2008 03:53 PM
ch 13 - sketcher menu problem zamontgo BOOK: Ivor Horton's Beginning Visual C++ 2005 0 May 24th, 2008 10:11 PM
Menu Help ch.2 klimek BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 2 June 7th, 2007 09:13 AM
Ch 6 Templated Controls geomar BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 2 February 3rd, 2007 07:58 PM
Menu hiding under controls arnabghosh Classic ASP Basics 2 June 17th, 2005 06:15 PM





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