Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Navigation Menu 'Empty' Node

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I am using Visual Studio 2010 VB.Net.
I have added a naviation menu to my site master page.
It has a horizontal orientation.
I have pointed the navigation Menu at an XML data source of menu items which works except that the far left shows an 'empty' option. When running the project it looks like a blank option.

Opening the Navigation control control up in design mode by selecting 'Edit Menu Items' shows two entries in the 'Available data bindings:' list.
The node first is '(Empty)' and the second is 'SiteMapNode'. The '(Empty)' one is causing my problem and I can't find a way to remove it so the navigation control is only set from the XML SiteMapNode.

Can anybody point me in the right direction on how to remove the '(Empty)' node?




Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Wierd. Solved it.

I spent ages trying to solve this on Friday and as soon as I post the question the penny drops and I figure it out.
My XML Site Map source was defined incorrectly.

How it was with the error - the top level node was of course empty
Code:
<siteMap xmlns="[URL unfurl="true"]http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"[/URL] >

  <siteMapNode>

  <siteMapNode url="" title="Options Sub-Menu 1"  description="Options Sub-Menu 1">
      <siteMapNode url="" title="Option 1"  description="Option 1" >
      </siteMapNode>

      <siteMapNode url="" title="Option 2"  description="Option 2" >
      </siteMapNode>
 </siteMapNode>


    <siteMapNode url="" title="Options Sub-Menu 2"  description="Options Sub-Menu 2">
      <siteMapNode url="" title="Option 1"  description="Option 1" >
      </siteMapNode>

      <siteMapNode url="" title="Option 2"  description="Option 2" >
      </siteMapNode>
    </siteMapNode>

</siteMapNode>
    
    
</siteMap>

How it is after correction - the top level node now has a value
Code:
<siteMap xmlns="[URL unfurl="true"]http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"[/URL] >

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

  <siteMapNode url="" title="Options Sub-Menu 1"  description="Options Sub-Menu 1">
      <siteMapNode url="" title="Option 1"  description="Option 1" >
      </siteMapNode>

      <siteMapNode url="" title="Option 2"  description="Option 2" >
      </siteMapNode>
 </siteMapNode>


    <siteMapNode url="" title="Options Sub-Menu 2"  description="Options Sub-Menu 2">
      <siteMapNode url="" title="Option 1"  description="Option 1" >
      </siteMapNode>

      <siteMapNode url="" title="Option 2"  description="Option 2" >
      </siteMapNode>
    </siteMapNode>

</siteMapNode>
    
    
</siteMap>



Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top