This is a migrated thread and some comments may be shown as answers.

Rotator and Binary Image

4 Answers 84 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Apostolos
Top achievements
Rank 1
Apostolos asked on 24 Aug 2010, 04:33 PM
Hi there.

I am trying to implement the example http://demos.telerik.com/aspnet-ajax/rotator/examples/gallery/defaultcs.aspx but with binary images instead of normal images from directory.

Can any one help me?

Thank you in advance.

4 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 27 Aug 2010, 12:53 PM
Hi Apostolos,

I have replaced the HTML image in the example with a RadBinaryImage control and attached it to the thread.

I hope this helps.

Regards,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Apostolos
Top achievements
Rank 1
answered on 27 Aug 2010, 03:18 PM
Dear Fiko, thank you for the immediate response.

But this doesn't quite solve my problem which is this: instead of reading images from a directory I need to read them directtly from an SQL database where the images are stored as binary objects. So, I would most probably need an updated version of the functions RebindRotator() and ShowImage(), in order to cope with this scenario.

Thank you in advance.

Best regards,

Apostolos
0
Keith Heilveil
Top achievements
Rank 1
answered on 30 Aug 2010, 08:58 PM
I had to solve the same issue recently.
What I've done is use a standard html <img> tag. Then, as the source, I have the address to a handler page.(e.g. http://localhost/mysite/myhandler.ashx?ImageID=1234 )

This handler then returns the object from the database

I use code (snippet) such as the below, to read the querystring

If

 

IsNothing(context.Request.QueryString("ImageID")) orelse IsNumeric(context.Request.QueryString("ImageID")) = false Then Exit Sub
ImageID = context.Request.QueryString("ImageID").ToString()

 


This assumes you read the data from the database, into an Object named "ImageObject"

ImageObject = cmd.ExecuteScalar()  ' Query here is unimportant as you will use your own and return the single field for the image.

 

If IsNothing(ImageObject) = False AndAlso ImageObject.ToString <> "" Then

 

context.Response.BinaryWrite(

DirectCast(ImageObject, Byte()))

 

 

End If

Hopefully this helps.

 

0
Apostolos
Top achievements
Rank 1
answered on 31 Aug 2010, 09:34 PM
Thanks Keith.

I' ll give it a try
Tags
Rotator
Asked by
Apostolos
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Apostolos
Top achievements
Rank 1
Keith Heilveil
Top achievements
Rank 1
Share this question
or