I am currently reading an image from an SQL Server database as byte[]. I would like to pass the image either as a byte[] or a real image to jQuery and dynamically load it.
How and what would be the best approach to do this?
Thanks in advance. :)
Edit: Here's the solution:
- Server-side / C#:
string json = JsonConvert.SerializeObject(employee); - Client-side / Ajax:
$('#image').attr('src', "data:image/jpg;base64,"+employee.Image);