RadBinaryImage works locally, not online

8 posts, 0 answers
  1. Lynn
    Lynn avatar
    2 posts
    Member since:
    Jan 2011

    Posted 13 Mar 2011 Link to this post

    I use the following code to display member images:

                    <asp:Repeater runat="server" id="Repeater1" DataSourceID="SqlDataSource1">
                            <fieldset class="chatter-picture">
                                <a href="#" onclick='selectChatter("<%#Eval("username") %>")'>
                                    <telerik:radbinaryimage runat="server" id="RadBinaryImage1" DataValue='<%#Eval("ImageData") %>'
                                        AutoAdjustImageControlSize="false" Width="67px" Height="50px" ToolTip='<%#Eval("username") %>'
                                        AlternateText='<%#Eval("username") %>' />
                <asp:SqlDataSource id="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                    SelectCommand="select top 30 username, i.ImageData from aspnet_Users u join member_Image i on i.UserId=u.UserId"></asp:SqlDataSource>

    This works fine on my local development machine. However, when I take the code to the production server, where the Telerik Rad Controls for AJAX have also been installed, the images do not show up. How do I troubleshoot this problem on the production server?

    Thank you for your time.
  2. Veli
    Veli avatar
    2002 posts

    Posted 15 Mar 2011 Link to this post

    Hi Lynn,

    If you are not getting any server or client-side errors, you can use your browsers developer tools to see if an image is returned from the URL of the <img> element RadBinaryImage has rendered. If no image is returned, check if there are any request errors when the browser makes an HTTP request to that URL. This is the WebResource handler URL RadBinaryImage uses to retrieve the binary image data from the server. The web resource handler should be registered in your application's web.config file as shown at the bottom of the RadBinaryImage online help topic.

    If the resource handler is properly registered, but your binary image is still not showing, i.e. no image is returned from the URL, the URL itself may not be valid. If you are using URL rewriting modules, for example, your URL rewriter may not interpret the resource handler URL correctly. You should exclude the resource handler URL from rewriting in these cases.

    Finally, RadBinaryImage is not supported in web farm or web garden hosting.

    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Lynn
    Lynn avatar
    2 posts
    Member since:
    Jan 2011

    Posted 16 Mar 2011 Link to this post

    Thank you for your quick response.

    I do not understand how to see if there are any request errors. Could you please describe how I would do this?

    Here is more information about my issue. I can view the images rendered correctly when I view the page locally on the server (localhost), but they do not show up when viewed remotely.

    I believe there is a path problem involved here, but I do not know what to set to correct the problem. One thing that I have tried is deleting the references to Telerik.Web.UI.dll and added the reference again. This is the reference in web.config:

          <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" />

    The URL for an example image is: http://www.peashakehouse.com/Telerik.Web.UI.WebResource.axd?imgid=f06701d9479d414ebf7979f7a0a68a44&type=rbi

    When I go to that URL I get a 404 file not found error. I get the same error for http://www.peashakehouse.com/Telerik.Web.UI.WebResource.axd, too.

    I'm just not clear on what to check, or how to troubleshoot this issue.


  4. Veli
    Veli avatar
    2002 posts

    Posted 16 Mar 2011 Link to this post

    If you are using Firefox, for example, you can use Firebug to inspect the HTTP requests the browser makes when loading your page. You can identify 3 scenarios with RadBinaryImage:

    1. Binary image data is found and properly returned by the WebResource handler. This is the expected properly working result:


    2. WebResource handler is not properly registered with your application and does not work. This happens when the Telerik.Web.UI.WebResource.axd resource handler is not properly registered in web.config and is not available:


    3. RadBinaryImage.DataValue is null and no binary image data is to be displayed. If you do not set binary data to RadBinaryImage.DataValue until the Render phase of the control, no requests the WebResource handler for image data are made. The <img> element rendered on the page does not contain a src tag to point to an image:


    These are the 3 cases identifyable with your browser's developer tools by examining the HTTP requests. Other problems with RadBinaryImage would normally involve server-side exceptions in your application (e.g. an error thrown when the byte[] data passed to DataValue is not recognized as a valid image).

    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
    EDUARDO avatar
    1 posts
    Member since:
    Aug 2012

    Posted 17 Aug 2012 Link to this post


    I also have the problem on my server online. When I run my website on the development machine works well, pointing to the same database for the server online. When I publish the website and try to access through the link www.primecliente.com/login.aspx only some images appear. If you refresh the page appear more images and so on;

    Here some details about my application;

    VS 2012
    SQL Server 2005
    Column photo varbinary (MAX)

    <telerik: RadBinaryImage runat = "server" ID = "RadBinaryImage1" DataValue = '<% # Eval ("imagemsite")%>'
    AutoAdjustImageControlSize = "False" Width = "150px" Height = "150px" />

    <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />

    <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />

    Development is done in Win7 and Win2003 Server with IIS uses online

  6. BabaYa
    BabaYa avatar
    16 posts
    Member since:
    Dec 2011

    Posted 22 Aug 2012 Link to this post

    Hi graciously

    I has similar problemas before and the cause was that my site is host on WebGarden server. But telerik sais that web garden is not supported:


    Collapse imageUnsupported scenarios

    • RadBinaryImage doesn't work in WebFarm / WebGarden scenarios

    After I remove webgarden all is fines.

  7. Jorge irving
    Jorge irving avatar
    5 posts
    Member since:
    Oct 2012

    Posted 24 Oct 2012 Link to this post

    Hello i have a similar problem, but whit all the rad controls for asp net, the error message says that i need to add a script manager before the controls (think that I all ready done on my master page), it seems to work perfect on my local machine but not on my development server.

    Am I missing something?

    Thanks in advance.
  8. Antonio Stoilkov
    Antonio Stoilkov avatar
    530 posts

    Posted 29 Oct 2012 Link to this post

    Hi Jorge,

    Based on your description it is hard to determine the cause of the problem. However, you try disabling the RadCompression (if enabled) in your application and observe if there are any differences. Additionally, you could check if the files on your local machine exactly match the content on the server.

    Antonio Stoilkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top