471,123 Members | 869 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,123 software developers and data experts.

web.sitemap question

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

Nov 23 '05 #1
1 1367
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

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by mike | last post: by
1 post views Thread by MDB | last post: by
5 posts views Thread by JJ | last post: by
4 posts views Thread by shapper | last post: by
5 posts views Thread by Tim Mackey | last post: by
3 posts views Thread by Anders | last post: by
2 posts views Thread by Bob | last post: by
1 post views Thread by VB Programmer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.