我有 2 个嵌套中继器,我的问题是关于显示结果。我希望它像这样显示:
标题 1
Images1
Caption2(应该在新行但不是)
Images2
Caption3(应该在新行但不是)
Images3
但结果是这样的:
http://s22.postimg.org/v53xrz40h/Capture.jpg
那么我该如何解决呢?
谢谢。
HTML:
<asp:Repeater ID="rptReferansBaslik" runat="server" OnItemDataBound="rptReferansBaslik_ItemDataBound">
<ItemTemplate>
<p>
<asp:Label ID="lblCaption" runat="server" Text='<%#Eval("Ref_Baslik") %>'></asp:Label>
</p>
<asp:Repeater ID="rptCalismalar" runat="server">
<ItemTemplate>
<ul id="mb_imagelist" class="mb_imagelist">
<li>
<img src='images/small/<%#Eval("CI_ThumNailURL") %>' alt="image1" data-bgimg='images/big/<%#Eval("CI_ImageURL") %>' /></li>
</ul>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
代码
protected void Page_Load(object sender, EventArgs e)
{
//List<Referanslar> list = Referanslar.GetReferanslarList("");
rptReferanslar.DataSource = Referanslar.GetReferanslarList("");
rptReferanslar.DataBind();
rptReferansBaslik.DataSource = Referanslar.GetReferanslarList("");
rptReferansBaslik.DataBind();
}
protected void rptReferansBaslik_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
Repeater rp = (Repeater)e.Item.FindControl("rptCalismalar");
int id = int.Parse(DataBinder.Eval(e.Item.DataItem, "Ref_ID").ToString());
rp.DataSource = CalismalarImages.GetCalismalarImagesList("SELECT * FROM CalismalarImages WHERE CI_CalismaID=" + id);
rp.DataBind();
}