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.