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性能高

你可能感兴趣的:(常用)