日期:2014-05-17 浏览次数:20459 次
<asp:DataList ID="DataList1" runat="server" RepeatColumns="3" Width="100%">
<ItemTemplate>
<asp:image ID="Image1" runat="server" width="180" ImageUrl='<%#"cpimage/" +Eval("Name")%>'/>
<br />
<br />
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Name")%>'></asp:Label>
<br />
<br />
</ItemTemplate>
</asp:DataList>
DirectoryInfo imagesfile = new DirectoryInfo(Server.MapPath("./cpimage"));
DataList1.DataSource = imagesfile.GetFiles("*.jpg");
DataList1.DataBind();