Making Dynamic Menu With Dropdowns
<p>I currently have dynamic menus like this:</p>

<pre><code>&lt;asp:Repeater runat="server" id="MenuRepeater"&gt;
  &lt;headertemplate&gt;
       &lt;div class="navbar navbar-inverse navbar-fixed-top"&gt;
      &lt;div class="navbar-inner"&gt;
        &lt;div class="container"&gt;
          &lt;a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;/a&gt;
          &lt;a class="brand" href="#"&gt;KezBlu&lt;/a&gt;
          &lt;div class="nav-collapse collapse"&gt;
            &lt;ul class="nav"&gt;
  &lt;/headertemplate&gt;
  &lt;itemtemplate&gt;
     &lt;li&gt;&lt;a href='&lt;%# Eval("PageFile") %&gt;'&gt;&lt;%# Eval("DisplayName") %&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;/itemtemplate&gt;
  &lt;footertemplate&gt;
             &lt;/ul&gt;
          &lt;/div&gt;&lt;!--/.nav-collapse --&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/footertemplate&gt;
 &lt;/asp:Repeater&gt;
</code></pre>

<p>And the datasource is:</p>

<pre><code> public partial class KezberProjectManager : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            MenuRepeater.DataSource = GetMenu();
            MenuRepeater.DataBind();
        }

        protected DataTable GetMenu() 
        {
          // you would normally pull this from a database, this is here
          // only to show the idea.
          DataTable menu = new DataTable();
          menu.Columns.Add("PageFile", typeof(String));
          menu.Columns.Add("DisplayName", typeof(String));

          DataRow row = menu.NewRow();
          row["PageFile"] = "home.aspx";
          row["DisplayName"] = "Home";
          menu.Rows.Add(row);

          row = menu.NewRow();
          row["PageFile"] = "Accounts.aspx";
          row["DisplayName"] = "Accounts";
          menu.Rows.Add(row);

          row = menu.NewRow();
          row["PageFile"] = "Logout.aspx";
          row["DisplayName"] = "Logout";
          menu.Rows.Add(row);

          return menu;
        }
    }
</code></pre>

<p>This works great, but I need sub menus too.</p>

<p>Would there be a way to in some way have repeaters for each item some how, or maybe a better way?</p>

<p>Thanks</p>
