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>

  • 相关阅读:
    Visual C#使用DirectX实现视频播放
    windows WMIC命令大全
    WMI 无法监视时必须要尝试的手段 winmgmt /resyncperf
    DirectX技术实现视频会议中的音频通信
    c++引用
    c++模板详解
    四元数
    static_cast 和 dynamic_cast
    C++堆和栈详解(转)
    设计模式六大设计原则
  • 原文地址:https://www.cnblogs.com/dzdrmmf/p/6377298.html
Copyright © 2011-2022 走看看