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

RadBinaryImage works locally, not online

7 Answers 360 Views
BinaryImage
This is a migrated thread and some comments may be shown as answers.
Lynn
Top achievements
Rank 1
Lynn asked on 14 Mar 2011, 01:00 AM
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.

7 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 15 Mar 2011, 03:33 PM
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!
0
Lynn
Top achievements
Rank 1
answered on 16 Mar 2011, 09:52 AM
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

0
Veli
Telerik team
answered on 16 Mar 2011, 11:14 AM
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!
0
EDUARDO
Top achievements
Rank 1
answered on 17 Aug 2012, 02:09 PM
Hello

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)

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

Web.config
<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

graciously
0
BabaYa
Top achievements
Rank 1
answered on 22 Aug 2012, 07:26 AM
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:

http://www.telerik.com/help/aspnet-ajax/binaryimage.html

Collapse imageUnsupported scenarios

  • RadBinaryImage doesn't work in WebFarm / WebGarden scenarios


After I remove webgarden all is fines.

Thanks
BabaYa
0
Jorge irving
Top achievements
Rank 1
answered on 24 Oct 2012, 02:34 PM
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.
0
Antonio Stoilkov
Telerik team
answered on 29 Oct 2012, 12:27 PM
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.

Greetings,
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.
Tags
BinaryImage
Asked by
Lynn
Top achievements
Rank 1
Answers by
Veli
Telerik team
Lynn
Top achievements
Rank 1
EDUARDO
Top achievements
Rank 1
BabaYa
Top achievements
Rank 1
Jorge irving
Top achievements
Rank 1
Antonio Stoilkov
Telerik team
Share this question
or