Results 1 to 2 of 2

Thread: Create Multi Level Menu

  1. #1

    Thread Starter
    Hyperactive Member kuldevbhasin's Avatar
    Join Date
    Mar 2008
    Location
    Mumbai, India
    Posts
    488

    Create Multi Level Menu

    hi i have a page which displays the menu from database it has 2 levels 1 main head and second action.
    but now i need to make 1 more level
    for e.g.
    Masters
    Attendance Related
    Daily Attendance
    Leave Details
    Employee Master
    ......
    Reports
    Attendance
    Leave Details
    and so on.

    what i am doing is as below :
    HTML Code:
    <asp:Repeater ID="rptCategories" runat="server" OnItemDataBound="rptMenu_OnItemBound">
                            <ItemTemplate>
                                <li data-toggle="collapse" data-target='#<%#Eval("InnerHtml") %>' class="menu-title">
                                    <li data-toggle="collapse" data-target='#<%#Eval("InnerHtml") %>' class="menu-title">
                                        <a href='<%#Eval("Url") %>' style="font-size: medium" >
                                           <i class='<%#Eval("CssFont") %>'></i>
                                            <span class="menu-title"><%#Eval("InnerHtml")%></span>
                                            <span class="arrow"></span><span class="arrow"></span>
                                        </a> 
                                    </li>
                                    <div class="icon-bg bg-pink"></div>
                                    <asp:Literal ID="ltrlSubMenu" runat="server" ></asp:Literal>
                                </li>
                            </ItemTemplate>
                        </asp:Repeater>
    Code:
     Menus = GetData("SELECT [MainID], [ParentId], [InnerHtml], [InnerHtml], [Url],[CssFont] FROM [MenuList] WHERE LoginType = 'Admin' Order By MyOrder")
            Dim view As New DataView(Menus)
            view.RowFilter = "ParentId=0"
            Me.rptCategories.DataSource = view
            Me.rptCategories.DataBind()
    i have tried a lot but am totally puzzled as to how to make a multi level menu.
    pls. guide
    thanks in advance
    The only time you run out of chances is when you stop taking them.
    The mind is like a parachute.
    It doesn’t work unless it’s open.

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: Create Multi Level Menu

    I have not worked with repeaters for quite some time, but here's a link to working with nested repeaters Display hierarchical data by using nested Repeater controls and Visual C# .NET.

    Perhaps you could try looking into jQuery UI or Bootstrap Menu?

    - kgc
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width