Rotator and Binary Image

5 posts, 0 answers
  1. Apostolos
    Apostolos avatar
    3 posts
    Member since:
    Aug 2010

    Posted 24 Aug 2010 Link to this post

    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.
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 27 Aug 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Apostolos
    Apostolos avatar
    3 posts
    Member since:
    Aug 2010

    Posted 27 Aug 2010 Link to this post

    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
  5. Keith Heilveil
    Keith Heilveil avatar
    29 posts
    Member since:
    May 2005

    Posted 30 Aug 2010 Link to this post

    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.

     

  6. Apostolos
    Apostolos avatar
    3 posts
    Member since:
    Aug 2010

    Posted 31 Aug 2010 Link to this post

    Thanks Keith.

    I' ll give it a try
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017