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

<nav class="navbar navbar-expand-lg navbar-dark bg-dark text-light py-1 mb-1">
  <%--<asp:LinkButton runat="server" ID="lbnUpdate" Text="---" OnClick="lbnUpdate_Click" CssClass="navbar-brand" ToolTip="HOME">Sauder NKC <i class="fa fa-object-group" aria-hidden="true"></i></asp:LinkButton>--%>
  <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 bg-dark" 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="600"></asp:XmlDataSource>
      <%--<li class="nav-item">
        <a class="nav-link text-light" href="ForceReload"><i class="fa fa-retweet shortcut-icon"></i> <%: traduci("ForceReload") %></a>
      </li>--%>
      <li class="nav-item">
        <a class="nav-link text-light" href="About"><i class="fa fa-dot-circle-o" aria-hidden="true"></i> <%: 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> <%: 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="Search" aria-label="Search" AutoPostBack="true" OnTextChanged="txtSearch_TextChanged" />
      <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>
