I am building a web.sitemap xml file for use as the data source for my Menu. I need only one level static menu to navigate my site. It seems that I have to nest the submenu inside the parent menu, otherwise it will not work. Thanks.
<siteMapNode url="~/Home" title="Home" description="Home">
<siteMapNode url="~/About this site" title="About this site" description="">
You can do something like:
<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="" title="" description=""> <siteMapNode url="~/Home" title="Home" description="Home" /> <siteMapNode url="~/About this site" title="About this site" description=""/> </siteMapNode> </siteMap>
It still appears as a two level menu, although the parent menu is empty. Actually what I want to do is to "highlight my current page", i.e. I want the back color of the button (menu) change to white after I press it. I searched the forum and internet and
follow many suggestions, like using function, Java script but still can not get it worked. I then came across one suggestion that it will work if the menu gets its data source from web.sitemap or xml file. It tried and it works, but have the present problem.
I found your code work for me if I place ShowStartingNode="false" in my <asp:SiteMapDataSource……>, such as,
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" />