I\'m using a database to store clients\' images as bytes. How can I render these images on an .aspx page?
This can be done easily by converting the Byte Array to a Base64 image.
public string GetImageAsBase64String(byte[] bin)
{
if (bin != null)
{
return "
";
}
else
{
return null;
}
}
//usage, for demo purposes an uploaded image from a FileUpload Control
Label1.Text = GetImageAsBase64String(FileUpload1.FileBytes);