我需要帮助才能让我的图像在文字控件中创建的标签中正确显示。
foreach (DataRow dr in dt.Rows)
{
string productName = dr["PRO_Name"].ToString();
string productPrice = dr["PRO_Price"].ToString();
byte[] productImg = (byte[])dr["PRO_Img"];
string sProduct = @"<div class='four-shop columns isotope-item'>
<div class='shop-item'>
<figure>
//I need the image from the data base here:
<img src='" + productImg + "' alt='' />
<figcaption center code herelass='item-description'>
<h5>" + productName + "</h5>
<span>R" + productPrice + "</span>
<a href='#' class='button color'>Add to Cart</a</figcaption>
</figure>
</div>
</div>";
//Im using a literal control to create the DIV dynamically for each product in the database.
productPanel.Controls.Add(new LiteralControl(sProduct));
}