gpt4 book ai didi

c# - 在中继器控制中设置中断

转载 作者:太空宇宙 更新时间:2023-11-03 22:20:59 25 4
gpt4 key购买 nike

我想在我的转发器控件中的每三个项目之后放置一个中断。我该怎么做?

<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>

代码隐藏:

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;
}
}

最佳答案

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

关于c# - 在中继器控制中设置中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3125096/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com