zoukankan      html  css  js  c++  java
  • .net repeater里 换行

    前台:

    <tr>
    <asp:Repeater ID="rtpNewImgs" runat="server" onitemdatabound="rtpNewImgs_ItemDataBound" >
            <ItemTemplate>
                      <td>
                                <%# Container.ItemIndex +  + 1  %>                                      

                      </td>
             </ItemTemplate>
      </asp:Repeater>
     </tr>

     

    后台:

    protected int i=1;

    protected void rtpNewImgs_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                //repter换行
                if (i % 2== 0 && i > 0)
                {
                    e.Item.Controls.Add(new LiteralControl(" </tr> <tr> "));
                }
                i++;
            }
        }

  • 相关阅读:
    文件操作
    python中的函数递归和迭代问题
    函数的闭包与装饰器
    函数的名称空间和作用域
    python学习之路(四) ---函数
    python __name__问题
    浅谈python中的引用和拷贝问题
    Python中的缩进问题
    粘包现象
    socket编程
  • 原文地址:https://www.cnblogs.com/YSO1983/p/2288489.html
Copyright © 2011-2022 走看看