Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > BinaryImage > RadBinaryImage works locally, not online

Not answered RadBinaryImage works locally, not online

Feed from this thread
  • Lynn avatar

    Posted on Mar 13, 2011 (permalink)

    I use the following code to display member images:

                    <asp:Repeater runat="server" id="Repeater1" DataSourceID="SqlDataSource1">
                        <ItemTemplate>
                            <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") %>' />
                                </a>
                            </fieldset>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
                <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.

    Reply

  • Veli Veli admin's avatar

    Posted on Mar 15, 2011 (permalink)

    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.

    Veli
    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!

    Reply

  • Lynn avatar

    Posted on Mar 16, 2011 (permalink)

    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:

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

    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.

    I

    Reply

  • Veli Veli admin's avatar

    Posted on Mar 16, 2011 (permalink)

    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:

    imagefound

    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:

    handlernotregistered

    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:

    noimagedata

    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).

    Greetings,
    Veli
    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!

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > BinaryImage > RadBinaryImage works locally, not online