repeate 常用的每行显示几个共几行

前台
OnItemDataBound="esfRepeater_OnItemDataBound"
 //数据绑定后激发的事件
        int i = 0;
        protected void esfRepeater_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (i % 4 == 0)
            {
                e.Item.Controls.Add(new LiteralControl("</div><div class='floatl'>"));
            }
            i++;
        }
        int j = 0;
        protected void rentRepeater_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (j % 4 == 0)
            {
                e.Item.Controls.Add(new LiteralControl("</div><div class='floatl'>"));
            }
            j++;
        }

 <%#(System.Data.DataRowView(Container.DataItem))["ClassName"]%>说是这个比eval性能高
posted @ 2011-07-08 10:11  老皆知  阅读(238)  评论(0编辑  收藏  举报