views:

18

answers:

2

Hi,

I have an ASP.NET Menu control that works based on a Web.Sitemap. Web.Sitemap does not allow me to have more than one item in its root. But I need my menu show more than one item in its root. Is it possible?

My sitemap is like:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="" title="Menu"  description="">
    <siteMapNode url="~/Default.aspx" title="Public"  description=""/>
    <siteMapNode url="" title="Administration"  description="">
      <siteMapNode url="~/GeneralSettings.aspx" title="GeneralSettings"  description=""/>
      <siteMapNode url="~/LookupManagement.aspx" title="Lookup"  description=""/>
      <siteMapNode url="~/Administration.aspx" title="Database"  description=""/>
    </siteMapNode>
    <siteMapNode url="~/AboutUs.aspx" title="Contact us"  description="" />
  </siteMapNode>
</siteMap>
A: 

Depending on how you're creating the menu, could you have a "dummy" root node, and your top-level items underneath this, and render the menu from these, effectively ignoring the root node?

harriyott
It's a good solution but how can I ignore root node?
afsharm
ShowStartingNode="false" in the data source, as Damien Dennehy says
harriyott
A: 

You probably have a SiteMap DataSource somewhere - change the "ShowStartingNode" attribute to be false.

<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false"/>
Damien Dennehy