web.sitemap question

J

johnb41

I want to create a web.sitemap file that represents a menu, but I just
can't figure this out! I need multiple "top level" menu items. Like
"Home", "Support", "Contact Us", etc. Under some of these top level
items, would be sub items. So in a dynamic menu, the sub item would
drop down when moused over.

The problem is that .net 2.0 gives an error if I have more than one
SiteMapNode directly under the SiteMap tag. For example, I can't do
this: (for simplicity, i didn't include code for the sub-items)

<siteMap>
<siteMapNode title="Home" />
<siteMapNode title="Support" />
<siteMapNode title="Contact Us" />
</siteMap>

So how can I have multiple Top Level menu items using web.sitemap?

Thanks!

John
 
J

johnb41

Just figured it out. Here's the solution:

<siteMap>
<siteMapNode>
<siteMapNode title="Home" />
<siteMapNode title="Support" />
<siteMapNode title="Contact Us" />
</siteMapNode>
</siteMap>

The "top level" items are actually sub items. By default doing this
doesn't work because the root siteMapNode doesn't have any value.

I had to add ShowStartingNode="False" here:

<asp:SiteMapDataSource ID="SiteMapDataSource1"
ShowStartingNode="False" runat="server" />

That fixed the problem. :)

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top