2014-10-15 4 views
0

나는 아래와 같은 몇 가지 datatable을 보여줍니다. 나는 그렇게 그들과 중첩 된 메뉴를 만들 수있는 방법asp.net에서 중첩 된 메뉴의 로직

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 

: http://www.keenthemes.com/preview/metronic/theme/templates/frontend/shop-index.html

<!-- 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 --> 

내가이 테마를 가지고 내가 espically 여성과 남성 카테고리와 같은 메뉴를 작성할 필요가 끝없는 중첩 된 UL> 리 하위 메뉴 항목에 이미지가 있으면 그 항목이 표시됩니다.

나는 asp repeater로 그들을 채울 수없고 말도 안되는 것처럼.

가장 좋은 방법은 무엇입니까?

답변

0

자식 컨트롤 배열이있는 컨트롤로 수행해야합니다. 예를 들어 TreeView는 UI를 사용자 정의 할 수있는 경우에 적합합니다. 리피터를 선택하면 aspx 코드가 아닌 코드 숨김을 수행하고 RepeaterItem으로 서브 링크를 동적으로 추가해야합니다.

관련 문제