PageAdmin网站内容管理系统(CMS)交流论坛

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

首页右侧栏目提取一个正常,同时提取两个栏目报错 [复制链接]

1#
如题,具体如下,一下代码只留班组工作栏目或考核情况栏目任何一个显示都正常,但是同时放两个栏目就报错,代码如下:   <!--首页_右侧当班情况-->
<div class="home_right_mk">
            <div class="home_rmk_tit">当班情况</div>
            <div class="home_rmk_com">
               @{
    int columnId = Html.CurrentColumnId();//当前栏目id
    PageInfo pageInfo = new PageInfo()
    {
        PageSize = 1,//每页显示12条数据
        CurrentPage = (int)ViewBag.CurrentPage //当前页码,系统预设
    };
    var dataList = Html.InfoDataList(new { ColumnId = 412,ShowNumber = 1 });
}


          
<table class="letter" width="100%" cellspacing="0" cellpadding="0" border="0">
                <tbody>
                  

                    @foreach (var item in dataList)
                    {
                        string Sbsj = item.Sbsj;
                        string Dbbz = item.Dbbz;
                        string Bzcy = item.Bzcy;
                        string Gznr = item.Gznr;
                        
                        string url = Html.InfoDataUrl((int)item.ColumnId, (int)item.Id);
                        { <tr class="head">
                        <td width="13%" align="center"><strong>上班时间</strong></td>
                        <td width="13%" align="center"><strong>当班班长</strong></td>
                        </tr>
            <tr class="item">
                                <td align="center">
                                    @Sbsj                                </td>
                                <td align="center">@Dbbz</td>
                            </tr>
            <tr class="item">
              <td align="center"><strong>班组成员</strong></td>
              <td align="center">@Bzcy</td>
            </tr>
            <tr class="item">
              <td align="center"><strong>工作内容</strong></td>
              <td align="center"><a href="@url" >详细情况</a></td>
            </tr>
            

                            
                          
                        }
                    }


          </tbody>
            </table>
            
            
          
  </div>
</div>
      

        <!--首页_考核情况-->
        <div class="home_right_mk">
            <div class="home_rmk_tit">考核情况</div>
            <div class="home_rmk_com">
               @{
    int columnId = Html.CurrentColumnId();//当前栏目id
    PageInfo pageInfo = new PageInfo()
    {
        PageSize = 1,//每页显示12条数据
        CurrentPage = (int)ViewBag.CurrentPage //当前页码,系统预设
    };
    var dataList = Html.InfoDataList(new { ColumnId = 424,ShowNumber = 1 });
}


          
<table class="letter" width="100%" cellspacing="0" cellpadding="0" border="0">
                <tbody>
                  

                    @foreach (var item in dataList)
                    {
                        string Khyf = item.Khyf;
                        string Yxbz = item.Yxbz;
                        string Dym = item.Dym;
                        string Dem = item.Dem;
string Dsm = item.Dsm;
string Khqk = item.Khqk;                        
                        string url = Html.InfoDataUrl((int)item.ColumnId, (int)item.Id);
                        { <tr class="head">
                        <td width="13%" align="center"><strong>考核月份</strong></td>
                        <td width="13%" align="center"><strong>月度优秀班长</strong></td>
                        </tr>
            <tr class="item">
                                <td align="center">
                                    @Khyf</td>
                                <td align="center">@Yxbz</td>
                            </tr>
            <tr class="item">
              <td align="center"><strong>第一名</strong></td>
              <td align="center">@Dym</td>
            </tr>
            <tr class="item">
              <td align="center"><strong>第二名</strong></td>
              <td align="center">@Dem</td>
            </tr>
            <tr class="item">
              <td align="center"><strong>第三名</strong></td>
              <td align="center">@Dsm</td>
            </tr>
            <tr class="item">
              <td align="center"><strong>考核内容</strong></td>
              <td align="center"><a href="@url" >详细情况</a></td>
            </tr>                                                              
                        }
                    }
          </tbody>
            </table>                    
  </div>
</div>
同时提取时,提示错误如图
,去掉其中任何一个栏目都显示正常,请老大指点,谢谢!
分享 转发
TOP
发新话题 回复该主题