zoukankan      html  css  js  c++  java
  • 循环输出ViewBag集合

    <tr>
                <td>
                    权限分配:
                </td>
                <td>
                    <table id="table1">
                        @{
                        
                            var userGroupArray = ViewBag.UserGroupLogSyslist as IList<UserGroupLogSys>;

                            if (userGroupArray != null && userGroupArray.Count > 0)
                            {

                                double userGroupCount = (userGroupArray.Count() * 1.0) / 5;
                                int iCount = (int)Math.Ceiling((decimal)userGroupCount);
                                int num = 0;
                                int jnum = 0;
                                for (int j = 0; j < iCount; j++)
                                {

                                    jnum = num;
                                
                            <tr>
                                @for (int i = num; i < userGroupArray.Count; i++)
                                {

                                    if (num % 5 == 0 && num != jnum)
                                    {
                                        break;
                                    }
                                    else
                                    {
                                  
                                    <td>
                                        <input type="checkbox" value="@userGroupArray[i].ID" name='checkboxs'/>
                                        @userGroupArray[i].userGroupFlag _ @userGroupArray[i].LogSys _ @userGroupArray[i].CompanyName
                                    </td>
                                        
                                    }

                                    num++;

                                }
                            </tr>
                                
                                }
                            }
                        }
                    </table>
                </td>
            </tr>

  • 相关阅读:
    1.SQL
    3.Dynamic Layout 动态布局。在槽中处理布局
    2.Border Layout 自定义一个Layout来完成布局。
    2.QWidget类
    eclipse内存设置,tomcat内存设置,查看内存大小
    java面试笔记
    java面试总结-(hibernate ibatis struts2 spring)
    jQuery属性,方法操作
    spring scope
    IOC原理解释
  • 原文地址:https://www.cnblogs.com/dzdrmmf/p/6377298.html
Copyright © 2011-2022 走看看