how to make line every three Item template in repeater asp.net

280 views Asked by At

I hava repeater in asp.net this repeater show books . I want to show three books then one line then three books .... ect?

<asp:Repeater ID="RpTrans" runat="server">                    
    <ItemTemplate>          
        <figure class="span3 slide">
            <a href="bookdetail.aspx?TransID=<%# Eval("TranslatedID")%>">
                <img src='admin/Uplouded/<%# Eval("Image")%>' alt="Image02"  
                     style="max-width:120px; height:120px;"  class="pro-img"/>
            </a>
            <span class="title">
                <a href="bookdetail.aspx?TransID=<%# Eval("TranslatedID")%>">
                   <%# Eval("TranslatedName")%><br /><%# Eval("ArabicName")%>
                </a>
            </span>
        </figure>
    </ItemTemplate>
</asp:Repeater>
1

There are 1 answers

0
4b0 On

Apply trick on your ItemDataBound

   protected void RpTrans_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
            int iti=e.Item.ItemIndex % 3;
            if (iti == 0)
            {
                divLine.Visible=true;
              //Show your Hidden line (may be its div with css) which is hidden  
            }
    }