By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,465 Members | 1,013 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,465 IT Pros & Developers. It's quick & easy.

web.sitemap question

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.