Put a binary image into HtmlGenericControl

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have in a database models of cars,

CarID int
CarName varchar
CarFeatures varchar
CarImage binary

I have a class Car that have the properties:
ID int
Name string
Features string
Image byte[]

My problem starts here:

i have into a page a

<span id=CarGenericControl runat=server>

and inside CarGenericControl.InnerHtml i have to show the Name, Features,
and Image foto of the car.

In this moment i show all the information except the foto, that i dont know
how to put it from byte[] into the Generic Control.

Do you have any advice for this specific case?
 
Josema,

You need to create a bytearray in a page and than do in that page
Response.BinaryWrite(arrImage);

That page do you reference in your image.ImageUrl =
UrlFromMyCreatedBitmapPage;

I hope this helps?

Cor
 
Hi Cor, first of all thanks for your early response.

Actually i have a byte array with the image loaded from binary field
(database).

My problem is based on:

1) have all the info to show (the image into a byte array, and all the rest
of the data that comes from database, varchar, etc...). But i only can use a
page to display all this data. And all this data i have to show into a
HtmlGenericControl.
Actually i dont have problems to show tha string data. but im trying to put
into the property InnerHtml the byte[] variable to show the image, but
without success.

Any help would be appreciated.
Thanks Cor.
Regards.
josema.
 
Josema,

I have seen a lot of people trying what you want to do (including me),
however AFAIK is it only possible to show the image using an imagebox (or
any other special object made for it as from macromedio).

However you never know that we both see an answer in half an hour.

Cor
 
Back
Top