tags:

views:

24

answers:

1

Hi, I want to place a break after every third item in my repeater control. How can i do that ?

<asp:Repeater ID="rptrExample" runat="server">
   <ItemTemplate>
      <td width="550px">
         <p>E <%# DataBinder.Eval(Container, "DataItem.price") %></p>
             <img alt='<%# DataBinder.Eval(Container, "DataItem.title") %>' src='<%# DataBinder.Eval(Container, "DataItem.url") %>'                                      width="184px" height="140px" style="border-color: #0d6e74; border: 1px" />
      </td>
   </ItemTemplate>
</asp:Repeater>

Codebehind:

public void LoadJewels()
{
    OdbcConnection conn;
    string requestbron = Request.QueryString["bron"];
    requestbron = requestbron != null ? requestbron : "1";
    conn = new OdbcConnection(ConfigurationManager.ConnectionStrings["jewelsConnectionString"].ConnectionString);
    conn.Open();
    string sql = "SELECT price, url FROM item AS a LEFT JOIN picture AS b ON a.iid = b.iid WHERE cid =" + Convert.ToInt32(requestbron) + " AND bigpicture =1";

    OdbcCommand cmd = new OdbcCommand(sql, conn);

    try
    {
        rptrExample.DataSource = cmd.ExecuteReader();
        rptrExample.DataBind();

        cmd.Connection.Close();
        cmd.Connection.Dispose();
    }
    catch (Exception ex)
    {
        lblStatus.Text = ex.Message;
    }
}
+1  A: 

<br runat="server" Visible="<%# (Container.ItemIndex % 3) == 2 %>" />

František Žiačik