I have created a menu using a repeater control linked to a sitemap file
The problem is I would like it to be dynamic, at top level only the parent links are shown, if you click on an item with child nodes in the sitemap it should go to that page and then display the additional manu items underneath.Code:<ul class="menu"> <li style="font-weight: bold; font-size: 0.75em; background-image: none; background: #C9AADC;"> <asp:HyperLink runat="server" ID="lnkHome" NavigateUrl="~/Default.aspx">Home</asp:HyperLink> </li> <asp:Repeater ID="Menu" runat="server" DataSourceID="SiteMapDataSource1" EnableViewState="False"> <ItemTemplate> <li style="font-size: 0.75em; background-image: none; background: #E0CCEB;"> <asp:HyperLink ID="HyperLink1" runat="server" Target='<%# Eval("Description") %>' NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink> <asp:Repeater ID="Repeater1" runat="server" DataSource='<%# CType(Container.DataItem, SiteMapNode).ChildNodes %>'> <ItemTemplate> <li style="font-size: 0.75em; background-image: none; background: #F4EEF8;"> <asp:HyperLink ID="HyperLink2" runat="server" Target='<%# Eval("Description") %>' NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink> </li> </ItemTemplate> </asp:Repeater> </li> </ItemTemplate> </asp:Repeater> </ul>
Has anyone doen this before or know of any links, the only dynamic menus I can see are .Nets own version which isnt customisable enough and dhtml one swhich I dont want to use.


Reply With Quote