用这个
<asp:Repeater ID="RepeaterImages" runat="server">
<ItemTemplate>
<img src='<%#GetImage(Databinder.Eval(Container.DataItem, "ImageID"))%>' alt="" width="" height="" />
</ItemTemplate>
</asp:Repeater>
Run Code Online (Sandbox Code Playgroud)
现在我们需要创建一个函数来使用该ID检索图像.
public string GetImage(object ImadeID)
{
if(ImageID!=null)
{
//do something with the ImageID to return the image path as string
}
else
{
return "";
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16571 次 |
| 最近记录: |