views:

30

answers:

1

Hi,

I use to render data using EntityDataSource, and I use to store customer image as byte in database, the problem is how can I convert that byte to base64 on .aspx page itself to use it as image src, is there any way to do this in javascript.

A: 

Why do you need to convert a byte[] to base64 string? This won't allow you showing the image on the page. You could write a generic handler (.ashx) that will query the database, fetch the image bytes and write them to the response stream. Then you simply instruct your image src property to this generic handler.

Darin Dimitrov
for your Information we can directly assign bytes as a Image src... http://stackoverflow.com/questions/3431095/how-to-display-an-image-stored-in-bytes-on-a-page
BreakHead
@Qutbuddin Kamaal, for your information this doesn't work on all browsers like IE7 and lower. Another drawback is that this will make your pages very large (Base64 encoded images are roughly 33% larger than their binary equivalent) and images won't be cached by the client browser.
Darin Dimitrov
Thanx Darin for your Information..dats why I luv dis site... :)
BreakHead
One more thanx you solve my one more issue :)
BreakHead