【发布时间】:2011-03-29 11:33:52
【问题描述】:
我正在创建一个页面,该页面将显示数据库中的多个图像... 如果我只显示一个图像,我可以通过使用要呈现为图像的页面来做到这一点。 像这样...
using (SqlDataReader reader = comm.ExecuteReader())
{
Byte[] images = new Byte[]();
while (reader.Read())
{
Response.BinaryWrite(images);
}
}
在我的 aspx 文件中:
<asp:Image ID="imgPhoto" runat="server" ImageUrl="~/ShowImages/LoadImages.aspx" Height="100px" Width="100px" BorderWidth="1px" />
我想要实现的是从数据库中显示多个图像,而不需要将页面呈现为图像...
有什么办法可以解决这个问题...?
谢谢大家
【问题讨论】:
标签: c# asp.net sql-server