Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery asp.net中嵌套菜单的逻辑_Jquery_Css_Asp.net_Webforms_Nested - Fatal编程技术网

Jquery asp.net中嵌套菜单的逻辑

Jquery asp.net中嵌套菜单的逻辑,jquery,css,asp.net,webforms,nested,Jquery,Css,Asp.net,Webforms,Nested,我有一些数据表,如下所示 ItemID MENU ParentID ImgUrl ----------- -------------------- ----------- ----------- 1 Home 0 2 Products 0 3

我有一些数据表,如下所示

ItemID         MENU                ParentID    ImgUrl   
----------- -------------------- ----------- -----------
1           Home                    0                   
2           Products                0                   
3           Categories              0                   
5           Products 1              2                   
6           Products 2              2                   
7           Products 3              2   
8           Products 2 1            6  
9           Categories  1           3           img1.jpg
10          Categories  2           3           img2.jpg
如何使用它们创建嵌套菜单,如下所示:

我有这个主题,我必须填写菜单,特别是像女性和男性类别,无限嵌套ul>li菜单,如果子菜单项有图像,它将显示

我不能用asp中继器填充它们,就像胡说八道一样


最好的方法是什么?

这必须使用具有子控件数组的控件来完成。例如,如果您可以自定义UI,那么TreeView就很好。如果您选择了一个中继器,那么您必须处理代码隐藏,而不是从aspx代码,并将子链接动态添加为中继器项

<!-- BEGIN NAVIGATION -->
<div class="header-navigation">
    <ul>
        <li class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="#">Woman</a>

            <!-- BEGIN DROPDOWN MENU -->
            <ul class="dropdown-menu">
                <li class="dropdown-submenu">
                    <a href="shop-product-list.html">Hi Tops <i class="fa fa-angle-right"></i></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="shop-product-list.html">Second Level Link</a></li>
                        <li><a href="shop-product-list.html">Second Level Link</a></li>
                        <li class="dropdown-submenu">
                            <a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="#">Second Level Link 

                                <i class="fa fa-angle-right"></i>
                            </a>
                            <ul class="dropdown-menu">
                                <li><a href="shop-product-list.html">Third Level Link</a></li>
                                <li><a href="shop-product-list.html">Third Level Link</a></li>
                                <li><a href="shop-product-list.html">Third Level Link</a></li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li><a href="shop-product-list.html">Running Shoes</a></li>
                <li><a href="shop-product-list.html">Jackets and Coats</a></li>
            </ul>
            <!-- END DROPDOWN MENU -->
        </li>
        <li class="dropdown dropdown-megamenu">
            <a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="#">Man </a>
            <ul class="dropdown-menu">
                <li>
                    <div class="header-navigation-content">
                        <div class="row">                         
                            <div class="col-md-4 header-navigation-col">
                                <h4>Clothing</h4>
                                <ul>
                                    <li><a href="shop-product-list.html">Base Layer</a></li>
                                    <li><a href="shop-product-list.html">Character</a></li>
                                    <li><a href="shop-product-list.html">Chinos</a></li>
                                    <li><a href="shop-product-list.html">Combats</a></li>
                                    <li><a href="shop-product-list.html">Cricket Clothing</a></li>
                                    <li><a href="shop-product-list.html">Fleeces</a></li>
                                    <li><a href="shop-product-list.html">Gilets</a></li>
                                    <li><a href="shop-product-list.html">Golf Tops</a></li>
                                </ul>
                            </div>
                            <div class="col-md-4 header-navigation-col">
                                <h4>Accessories</h4>
                                <ul>
                                    <li><a href="shop-product-list.html">Belts</a></li>
                                    <li><a href="shop-product-list.html">Caps</a></li>
                                    <li><a href="shop-product-list.html">Gloves, Hats and Scarves</a></li>
                                </ul>

                                <h4>Clearance</h4>
                                <ul>
                                    <li><a href="shop-product-list.html">Jackets</a></li>
                                    <li><a href="shop-product-list.html">Bottoms</a></li>
                                </ul>
                            </div>
                            <div class="col-md-12 nav-brands">
                                <ul>
                                    <li><a href="shop-product-list.html">
                                        <img title="esprit" alt="esprit" src="../../assets/frontend/pages/img/brands/esprit.jpg"></a></li>
                                    <li><a href="shop-product-list.html">
                                        <img title="gap" alt="gap" src="../../assets/frontend/pages/img/brands/gap.jpg"></a></li>
                                    <li><a href="shop-product-list.html">
                                        <img title="next" alt="next" src="../../assets/frontend/pages/img/brands/next.jpg"></a></li>
                                    <li><a href="shop-product-list.html">
                                        <img title="puma" alt="puma" src="../../assets/frontend/pages/img/brands/puma.jpg"></a></li>
                                    <li><a href="shop-product-list.html">
                                        <img title="zara" alt="zara" src="../../assets/frontend/pages/img/brands/zara.jpg"></a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </li>
            </ul>
        </li>
        <li><a href="shop-item.html">Kids</a></li>
        <li class="dropdown dropdown100 nav-catalogue">
            <a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="#">New

  </a>
            <ul class="dropdown-menu">
                <li>
                    <div class="header-navigation-content">
                        <div class="row">
                            <div class="col-md-3 col-sm-4 col-xs-6">
                                <div class="product-item">
                                    <div class="pi-img-wrapper">
                                        <a href="shop-item.html">
                                            <img src="../../assets/frontend/pages/img/products/model4.jpg" class="img-responsive" alt="Berry Lace Dress"></a>
                                    </div>
                                    <h3><a href="shop-item.html">Berry Lace Dress</a></h3>
                                    <div class="pi-price">$29.00</div>
                                    <a href="#" class="btn btn-default add2cart">Add to cart</a>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-4 col-xs-6">                        
                                <div class="product-item">
                                    <div class="pi-img-wrapper">
                                        <a href="shop-item.html">
                                            <img src="../../assets/frontend/pages/img/products/model3.jpg" class="img-responsive" alt="Berry Lace Dress"></a>
                                    </div>
                                    <h3><a href="shop-item.html">Berry Lace Dress</a></h3>
                                    <div class="pi-price">$29.00</div>
                                    <a href="#" class="btn btn-default add2cart">Add to cart</a>
                                </div>
                            </div>                         
                        </div>
                    </div>
                </li>
            </ul>
        </li>
        <li class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="#">Pages 

  </a>

            <ul class="dropdown-menu">
                <li class="active"><a href="shop-index.html">Home Default</a></li>
                <li><a href="shop-index-header-fix.html">Home Header Fixed</a></li>
                <li><a href="shop-index-light-footer.html">Home Light Footer</a></li>
                <li><a href="shop-product-list.html">Product List</a></li>
                <li><a href="shop-search-result.html">Search Result</a></li>
                <li><a href="shop-item.html">Product Page</a></li>
                <li><a href="shop-shopping-cart-null.html">Shopping Cart (Null Cart)</a></li>
                <li><a href="shop-shopping-cart.html">Shopping Cart</a></li>
                <li><a href="shop-checkout.html">Checkout</a></li>
                <li><a href="shop-about.html">About</a></li>
                <li><a href="shop-contacts.html">Contacts</a></li>
                <li><a href="shop-account.html">My account</a></li>
                <li><a href="shop-wishlist.html">My Wish List</a></li>
                <li><a href="shop-goods-compare.html">Product Comparison</a></li>
                <li><a href="shop-standart-forms.html">Standart Forms</a></li>
                <li><a href="shop-faq.html">FAQ</a></li>
                <li><a href="shop-privacy-policy.html">Privacy Policy</a></li>
                <li><a href="shop-terms-conditions-page.html">Terms &amp; Conditions</a></li>
            </ul>
        </li>
        <li><a href="index.html" target="_blank">Corporate</a></li>

    </ul>
</div>
<!-- END NAVIGATION -->