Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > BinaryImage > Image does not display

Not answered Image does not display

Feed from this thread
  • David Simmonds avatar

    Posted on Nov 9, 2011 (permalink)

    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();

    Reply

  • Posted on Nov 10, 2011 (permalink)

    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.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > BinaryImage > Image does not display