[RESOLVED]Add current style

I’ve a repater in a Masterpage to build a menu binded to websitemap.

This i the code:

<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False"/>
	        <div class="menu-search">
            <asp:Repeater runat="server" ID="menu" DataSourceID="SiteMapDataSource1">
                <HeaderTemplate>
                    <ul id="topnav">
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink>
                        <asp:Repeater ID="submenu" runat="server" DataSource='<%# DirectCast(Container.DataItem, SiteMapNode).ChildNodes%>'>
                            <HeaderTemplate>
                                <ul>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <li runat="server" id="idLi">
                                    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink>
                                </li>
                            </ItemTemplate>
                            <FooterTemplate>
                                </ul>
                            </FooterTemplate>
                        </asp:Repeater>
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    </ul>
                </FooterTemplate>
            </asp:Repeater>
	        </div>

My problem is add "current" style to selected menu.

How I can do this?

There is a way to do this?

Using itemdatabound event?

Hi,

Check this site with similar issue with solution:

http://forums.asp.net/t/1423698.aspx/1

Leave a Reply