我想顯示圖片從文件夾圖像與中繼器,但probelm圖片無法顯示我不知道爲什麼。圖像不顯示與asp.net中繼器
<div data-u="slides" style="cursor: default; position: relative; top: 0px; left: 0px; width: 800px; height: 356px; overflow: hidden;">
<asp:Repeater runat="server" ID="RepaterImages">
<ItemTemplate>
<div runat="server" data-p="144.50">
<img id="Image" runat="server" data-u="image" style="Width:120px;" src='<%#Container.DataItem %>'/>
</div>
</ItemTemplate>
</asp:Repeater>
</div>
protected void Page_Load(object sender, EventArgs e)
{
int id = Convert.ToInt32(Request.QueryString["id"]);
var path = Server.MapPath("ProjectsImages/ ");
var images = Directory.GetFiles(path,id+"*");
ArrayList list = new ArrayList();
foreach (var img in images)
{
list.Add(img);
}
RepaterImages.DataSource = images;
RepaterImages.DataBind();
}
請張貼**呈現您的網頁的HTML **。 – Dai
更改'<%#Container.DataItem%>'到'<%#Eval(「columnName」)%> – VDWWD
@VDWWD我從文件夾而不是數據庫表中檢索圖像 – hashim