Image does not display

2 posts, 0 answers
  1. David Simmonds
    David Simmonds avatar
    56 posts
    Member since:
    Mar 2010

    Posted 09 Nov 2011 Link to this post

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

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Nov 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top