【发布时间】:2014-12-14 15:13:05
【问题描述】:
我有以下中继器:
<asp:Repeater runat="server" ID="rptnewfeeds">
<ItemTemplate>
<div id="main" role="main" style="width: 1153px; margin-top: -105px; left: 105px; position: absolute;">
<ul id="tiles">
<li>
<asp:Image ID="Image4" runat="server" ImageUrl='<%#Eval("image") %>' />
</li>
</ul>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
代码:-
DataSet ds = new DataSet();
string select = "select image from UserProfileData where date>='2013-09-01'";
SqlDataAdapter da = new SqlDataAdapter(select, _connect());
da.Fill(ds);
rptnewfeeds.DataSource = ds;
rptnewfeeds.DataBind();
现在绑定所有the images as same size,但我想将所有图像都绑定为different size
例如假设现在这 10 张图片有 width=200 and height=200
now i want like 1st image has width=200 and height=300
2nd image has width=200 and height=283
3rd image has width=200 and height=230
...
... and so on
那我该怎么做呢?
如何在中继器中获取所有随机高度的图像?
有什么想法吗?
【问题讨论】: