【发布时间】:2014-05-03 16:37:54
【问题描述】:
来自数据库图像计数的带有 ashx 的图像后面(使用“for”)。问题是每张图片显示两次..我搜索了它但找不到解决方案。谢谢..
fancybox 版本:2.1.5 jquery : 最新版本。
Label lbl = new Label();
lbl.Text = "<a class=fancybox rel=group href=picture0.ashx?id=" + dt.Rows[i]["id"].ToString() + " style=margin-right:15px;>";
Panel1.Controls.Add(lbl);
Image img = new Image();
img.ImageUrl = "Picture0.ashx?id="+dt.Rows[i]["id"].ToString();
img.Width = 110;
img.Height = 80;
Panel1.Controls.Add(img);
Label lbl2 = new Label();
lbl2.Text = "</a>";
Panel1.Controls.Add(lbl2);
和html部分是;
$(文档).ready(函数 () { $('.fancybox').fancybox({ 'type': 'image', }); }); <asp:Panel ID="Panel1" runat="server">
【问题讨论】:
-
包含您的代码发出的实际源 HTML 可能会有所帮助。您能在生成的标记中看到重复项吗?