zoukankan      html  css  js  c++  java
  • 取出dictionary中的值

      var dic=ViewBag.dic as Dictionary<string,List<TeenySoft.Web.Model.wx_shop.ProductInfo>>;
        if (dic!=null)
        {
              foreach (var item in dic.Keys)
                {
        <li style="height: 60px; border-bottom: 1px solid #999999; margin-left: -10px">
            <a href="/shop/product/productList" title="" style="margin-left:10px;">@item</a>  <a style="float: right; margin-right: 10px;">></a>
            <div style="height: 32px; border-bottom: none">
                <div style="float: left;"><a style="margin-left: 10px; font-size: 16px"></a></div>
                <div class="divp" style="height: 19px;">
                <ul>
                    @foreach (var item1 in dic[item])
                                        {
                                            {
                                                string strname = item1.productName.Length>4 ?item1.productName.Substring(0,4):item1.productName;
                                            
                        <li style="60px;"><a href="@("/shop/product/productDetail?productId=" + item1.id + "&pd_id=" + item1.pd_id +"&s_id="+item1.s_id)">@strname、</a></li>  
                                            }
                                      }
                </ul>
            </div>
            </div>
        </li>
                            }
                   }      }
  • 相关阅读:
    用SQL SERVER取分组数据第一条:查出每个班级的成绩第一名
    [转]spring beans.xml
    [转]为什么要使用框架
    MySQL 5.6 for Windows 解压缩版配置安装
    [转]hql 语法与详细解释
    [转]slf4j + log4j原理实现及源码分析
    [转]最详细的Log4j使用教程
    yii2 checkbox 的使用实例
    Magento Order 状态详解
    yii2 设置多个入口文件
  • 原文地址:https://www.cnblogs.com/superMay/p/6397835.html
Copyright © 2011-2022 走看看