<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_menuTop.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_menuTop" %>

<asp:HiddenField runat="server" ID="hfAnonym" />
<nav class="navbar navbar-expand-lg navbar-dark bg-primary text-light py-1 mb-1">
    <a class="navbar-brand" href="../">Sauder NKC <i class="fa fa-object-group" aria-hidden="true"></i></a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            <asp:Repeater ID="menu" runat="server" DataSourceID="XmlMenu">
                <ItemTemplate>
                    <li class="nav-item dropdown">
                        <a href='<%# XPath("@url").ToString().Replace("~/","") %>' class="nav-link dropdown-toggle text-light" data-toggle="dropdown">
                            <i class='<%# XPath("@description")%>'></i>
                            <%# XPath("@title")%>
                            <b class="caret"></b>
                        </a>
                        <div class="dropdown-menu">
                            <asp:Repeater ID="voci" runat="server" DataSource='<%# XPathSelect("voce") %>'>
                                <ItemTemplate>
                                    <a href='<%# XPath("@url").ToString().Replace("~/","")%>' class="dropdown-item py-0">
                                        <i class='<%# XPath("@description")%>'></i>
                                        <%# XPath("@title")%>
                                    </a>
                                </ItemTemplate>
                            </asp:Repeater>
                        </div>
                    </li>
                </ItemTemplate>
                <SeparatorTemplate>
                </SeparatorTemplate>
            </asp:Repeater>
            <asp:XmlDataSource ID="XmlMenu" runat="server" EnableCaching="True" CacheDuration="5"></asp:XmlDataSource>
            <li class="nav-item">
                <a class="nav-link text-light" href="About"><i class="fa fa-dot-circle-o" aria-hidden="true"></i>&nbsp;<%: traduci ("About") %></a>
            </li>
            <li class="nav-item">
                <a class="nav-link text-light" href="Contact"><i class="fa fa-handshake-o" aria-hidden="true"></i>&nbsp;<%: traduci ("Contacts") %></a>
            </li>
        </ul>
        <div runat="server" id="divSearch" class="form-inline my-2 my-lg-0">
            <asp:TextBox runat="server" ID="txtSearch" class="form-control mr-sm-2" type="search" placeholder="[S]earch" aria-label="Search" AutoPostBack="true" OnTextChanged="txtSearch_TextChanged" AccessKey="S" />
            <asp:LinkButton runat="server" ID="lbtSearch" class="btn btn-secondary my-2 my-sm-0" type="submit" OnClick="lbtSearch_Click"># <%: traduci ("Search") %> <i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
        </div>
    </div>
</nav>