如何添加Sub DropDown菜单

时间:2015-03-31 04:29:42

标签: html drop-down-menu

我是HTML的初学者,需要你们的帮助

我想添加Sub DropDown菜单,在Tutorials Dropdown菜单中我有三个主要的下拉菜单,即:HTML5,CSS,JQuery

现在我想展示另外两个子菜单:HTML 5下拉菜单下的下载和视频

<div class="collapse navbar-collapse navbar-right navbar-main-collapse">
<ul class="nav navbar-nav">
  <li class="active"><a href="#intro">Home</a></li>
  <li><a href="#about">About</a></li>
  <li><a href="#service">Service</a></li>
  <li><a href="#contact">Contact</a></li>
  <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Tutorials<b class="caret"></b></a>
    <ul class="dropdown-menu">
    <li><a href="#">HTML 5</a></li>
      <!-- here i would like to show two sub dropdown menus, first Downlo ads and second Videos  --> 
    <li><a href="#">CSS</a></li>
    <li><a href="#">JQuery</a></li>
  </ul>
 </li>
 </ul>
</div>

1 个答案:

答案 0 :(得分:0)

您将不得不使用另一个下拉列表与SelectedIndexChanged事件触发第二个下拉列表。这样的事情:

<asp:DropDownList ID="DropDownList1" runat="server" onselectedindexchanged="DropDownList1_SelectedIndexChanged" Width="224px"
    AutoPostBack="True" AppendDataBoundItems="true">
<asp:DropDownList ID="DropDownList2" runat="server"
    onselectedindexchanged="DropDownList2_SelectedIndexChanged">
</asp:DropDownList> 


protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
//Load DropDownList2

}

由于您尚未发布代码,因此无法为您提供更多帮助。