zoukankan      html  css  js  c++  java
  • cshtml交替显示行数据

     @{

                                IList
    <string> styleClassCode = new List<string>();
                                styleClassCode.Add(@sc.StyleClassCode.ToString());
                                var i
    =0;
                                var length
    =Mola.Admin.Web.Controllers.ProductController.GetStyleClassLangList(styleClassCode).Count;
                                
    foreach (Mola.Model.GY_StyleClassLangEntity scl in Mola.Admin.Web.Controllers.ProductController.GetStyleClassLangList(styleClassCode))
                                {
                                    
    if (i <length )
                                    {
                                        
    if (i % 2 == 0)
                                        {
                                                
    <tr style="background-color:#CCC">
                                                    
    <td width="492">@scl.Title</td>
                                                    
    <td width="395">@scl.Tags</td>                        
                                                    
    <td width="103">@scl.LangName</td>
                                                    
    <td width="55"><a href='EditSytleClassLang.aspx?Action=Edit&id=@scl.Id'>修改</a>
                                                    
    </td>
                                                
    </tr>
                                        }
                                        
    else
                                        {
                                                
    <tr style="background-color:#DEF">
                                                    
    <td width="492">@scl.Title</td>
                                                    
    <td width="395">@scl.Tags</td>                        
                                                    
    <td width="103">@scl.LangName</td>
                                                    
    <td width="55"><a href='EditSytleClassLang.aspx?Action=Edit&id=@scl.Id'>修改</a>
                                                    
    </td>
                                                
    </tr>
                                        }
                                        i
    ++;
                                    }
                                }
                                   
                             }
  • 相关阅读:
    JavaWeb-ajax
    数据库-条件查询和分页
    JSP-EL和JSTL
    ROS的STM32电机驱动
    rosserial_python serial_node.py分析--补遗
    rosserial_python serial_node.py分析
    Python的matplotlib绘图
    kNN算法与python
    利用网售的PID调制工具配置电机PID参数
    mbed的ticker问题
  • 原文地址:https://www.cnblogs.com/shizhi57/p/2095213.html
Copyright © 2011-2022 走看看