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

Image does not display

1 Answer 163 Views
BinaryImage
This is a migrated thread and some comments may be shown as answers.
David Simmonds
Top achievements
Rank 1
David Simmonds asked on 09 Nov 2011, 04:40 PM
I have a RadBinaryImage in a asp:Repeater template. I also have a RadBinaryImage in a RadRotator template. The Repeater works. The Rotator does not. What am I doing wrong?
<asp:Repeater runat="server" ID="AttachmentRepeater" EnableViewState="false">
    <ItemTemplate>
        <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" ResizeMode="Fit" DataValue='<%# Eval("Image")%>' Width="200" Height="200" />
    </ItemTemplate>
</asp:Repeater>
 
        <telerik:RadRotator ID="thumbRotator" runat="server" RotatorType="ButtonsOver" Width="572"
            Height="118px" ItemHeight="118" ItemWidth="145" FrameDuration="1000" ScrollDirection="Left,Right" OnItemClick="ShowImage">
            <ItemTemplate>
                <div>
                    <telerik:RadBinaryImage ID="RadBinaryImage2" runat="server" ResizeMode="Fit"
                                             DataValue='<%# Eval("Image")%>' Width="200" Height="200" />
                </div>
            </ItemTemplate>
            <ControlButtons LeftButtonID="img_left" RightButtonID="img_right" />
        </telerik:RadRotator>

In the following code, the Images collection contains objects that have a Byte[] property and a String property. The Byte[] is the contents of an image acquired by using an AsyncUpload control.

DataTable rotatorData = new DataTable();
 rotatorData.Columns.Add("Image", typeof(System.Array));
 rotatorData.Columns.Add("Name");
 foreach (ImageInfo tempInfo in Images)
 {
     DataRow row = rotatorData.NewRow();
     row["Image"] = tempInfo.Image;
     row["Name"] = tempInfo.Name;
     rotatorData.Rows.Add(row);
 }
 thumbRotator.DataSource = rotatorData;
 thumbRotator.DataBind();

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Nov 2011, 11:15 AM
Hello David,

I have tried the same scenario and that worked as expected. Please make sure that you have registered the http handler of the RadBinaryImage control as explained here.
aspx:
<telerik:RadRotator ID="RadRotator1" runat="server" Width="305px" Height="114px" ScrollDuration="500" FrameDuration="2000" ItemHeight="110" ItemWidth="100" DataSourceID="SqlDataSource1">
         <ItemTemplate>
              <telerik:RadBinaryImage runat="server"  ID="RadBinaryImage1" DataValue='<%#Bind("Picture") %>'
                  AutoAdjustImageControlSize="false" Width="90px" Height="110px" AlternateText="No Image!!" />
            </ItemTemplate>
</telerik:RadRotator>

Thanks,
Shinu.
Tags
BinaryImage
Asked by
David Simmonds
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or