views:

123

answers:

4

I using SiteMapPath with an xml file for data. I would like to use the same file for another menu, but I need to have more information attached to each node.

<siteMapNode target="_blank" url="~/Default.aspx" title="Home"  description="Home Page" >
VS
<siteMapNode url="~/Default.aspx" title="Home"  description="Home Page" >

So far it doesn't break on my box, but will I run into problems later? Or is there a better way?

+1  A: 

Doubtfull you'll run into any problems. Whatever is consuming your sitemap file is only going to parse known attributes. Extra attributes will go ignored.

Todd Smith
+3  A: 

Microsoft has always intended for siteMapNode elements to allow custom attributes on them. You can access the values of those attributes with the indexer on the SiteMapNode class.

The ASP.NET QuickStart Tutorials briefly mention this feature here.

Jason Diamond
+1  A: 

I use this approach quite often and for quite some time. It has not caused me any problems. The only downside is the code needed to parse them.

Dan
A: 

I agree with the other answers. XML is meant to be eXtensible.