Image Not Displaying In DataList

3 posts, 1 answers
  1. Joe
    Joe avatar
    26 posts
    Member since:
    May 2009

    Posted 23 Feb 2010 Link to this post

    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. Answer
    Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 24 Feb 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Joe
    Joe avatar
    26 posts
    Member since:
    May 2009

    Posted 24 Feb 2010 Link to this post

    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
Back to Top