Tuesday, May 16, 2006

Extending SiteMap Xml file

Sometimes you need to store information on per page basis. For example you need keywords or publish date. I think good choice for this can became Web.SiteMap.

To implement this just add namespace to the root of the XML file. Something like: <sitemap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" xmlns:exs="SiteMap-Extend" > Now you can easely add your attributes without any validation warnings. For example:
<sitemapnode url="~/Default.aspx" title="Home" description="" exs:keywords="test, something, oops" > From this time this attributes accesible from the code like: SiteMap.CurrentNode["exs:keywords"]



Post a Comment

Subscribe to Post Comments [Atom]

<< Home