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

Image Not Displaying In DataList

2 Answers 96 Views
BinaryImage
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 24 Feb 2010, 02:35 AM
Hi,

Is there something I am missing.  My images won't display.  I have a datalist that is bound from code behind.  Here is what it looks like:

.ascx
<asp:DataList ID="dlProducts" runat="server" RepeatColumns="4" RepeatDirection="Horizontal" 
            RepeatLayout="Table" ItemStyle-CssClass="ItemBox"
            <ItemTemplate> 
                <ul> 
                    <li> 
                        <telerik:RadBinaryImage ID="rbiGridImage" runat="server" DataValue='<%# DataBinder.Eval(Container.DataItem, "PictureBinary") %>' /> 
                    </li> 
                    <li> 
                        <%# DataBinder.Eval(Container.DataItem, "Name") %></li
                    <li> 
                        <%# DataBinder.Eval(Container.DataItem, "OldPrice") %></li
                    <li> 
                        <%# DataBinder.Eval(Container.DataItem, "Price") %></li
                    <li> 
                        <%# DataBinder.Eval(Container.DataItem, "MName") %></li
                </ul> 
            </ItemTemplate> 
        </asp:DataList> 
 All other fields display correctly and if I remove the RadBinaryImage and bind the raw data I get "<Binary Data>" so I know I am binding correctly.

Any ideas?
One more thing, if I the run query that loads my data the "PictureBinary" field data looks like this:
0xFFD8FFE000104A46494600010101004800480000FFE1118545.....
Which looks pretty binary to me.
Thanks. Joe.


2 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 24 Feb 2010, 09:03 AM
Hi Joe,

Can you please verify that you have correctly registered the Telerik.Web.UI.WebResource handler in the webconfig? You can do this using RadBinaryImage smartTag or manually by adding following lines to your webconfig:

for IIS classic pool or VS's webdevelopmnet server:
<configuration
   <system.web
       <httpHandlers
   <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" /> 
       </httpHandlers
   </system.web
</configuration>

if integrated pool is used:
<system.webServer
… 
<handlers
… 
 <add name="Telerik.Web.UI.WebResource"  path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" /> 
… 
</handlers
</system.webServer>


Greetings,
Rosen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Joe
Top achievements
Rank 1
answered on 24 Feb 2010, 10:04 PM
Hi Rosen,

That was it!  Easy peezy.

I guess I should read the instructions better.  I read that the http handler was integrated so it never occurred to me that I still needed to reference in the web.config.  Duh.

thanks Rosen.

joe
Tags
BinaryImage
Asked by
Joe
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Joe
Top achievements
Rank 1
Share this question
or