rotator doesn't display images from sql database

4 posts, 0 answers
  1. Preeti
    Preeti avatar
    8 posts
    Member since:
    Jan 2014

    Posted 08 Jan 2014 Link to this post

    i am using this example
    http://demos.telerik.com/aspnet-ajax/rotator/examples/net35datasources/defaultcs.aspx

    below is my code

      <fieldset class="fieldsetClass">
                   <legend>EntityDataSource</legend>
                   <telerik:RadRotator runat="server" ID="RadRotator2" DataSourceID="SqlDataSource1"
                        ScrollDirection="Left" Width="600px" ItemWidth="300px" Height="120px" ItemHeight="120px">
                        <ItemTemplate>
                             <div class="itemTemplateWithButtons">
                                  <asp:Image ID="CustomerImage" runat="server" AlternateText="Customer image" ImageUrl='<%#"~/ImageHandlers/ProjectImageHandler.ashx?id="+ Eval("project_id") %>'
                                       CssClass="customerImage"></asp:Image>
                                  <div class="customerProp">
                                       <div class="customerName">
                                            <asp:Label ID="CustomerName" runat="server"><%# DataBinder.Eval(Container.DataItem, "project_name")%></asp:Label>
                                       </div>
                                       <div class="customerCity">
                                            <asp:Label ID="CustomerCity" runat="server"><%# DataBinder.Eval(Container.DataItem, "project_type")%></asp:Label>
                                       </div>
                                       <div class="customerCountry">
                                            <asp:Label ID="CustomerCountry" runat="server"><%# DataBinder.Eval(Container.DataItem, "current_state")%></asp:Label>
                                       </div>
                                  </div>
                             </div>
                        </ItemTemplate>
                   </telerik:RadRotator>
              </fieldset>

     <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                  ConnectionString="Data Source=192.168.0.63;Initial Catalog=RealEstateDomain;Persist Security Info=True;User ID=sa;Password=techfreedom@123" 
                  ProviderName="System.Data.SqlClient" 
                  SelectCommand="SELECT * FROM [ProjectMaster]"></asp:SqlDataSource>
              
    I am getting all the data from database but not getting images.....image area s blank...
    please help me what can i do...i also dont have radbinaryimage control in my telerik controls
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 09 Jan 2014 Link to this post

    Hi Preeti,

    As I see the images are served by your own custom handler. You should check if the names provided to it are correct and what it returns. You can try it outside of a rotator to test it, there should be no difference. In either case an URL is generated that is set to the src attribute of an img tag. If this URL is wrong or the handler does not return the expected data, then the issue is not with our controls. The demo itself does not use a handler, but builds an URL to a folder that contains the images in the site.

    On the RadBinaryImage control - if you do not see it, the most likely reason is that your RadControls version is very old (around Q1 2009 or older), before the release of the control. To get it you would need to upgrade.


    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Preeti
    Preeti avatar
    8 posts
    Member since:
    Jan 2014

    Posted 09 Jan 2014 Link to this post

    Thanx Marin..
       As you said I checked my code by applying debuger on my imagehandler but on runnig project the control is not going on imagehandler...I think there must be some other way to give the path of imagehandler. Can you help me in getting my images which are saved in sql database, to present them in a slide show I don't have a static folder of those images they are inserting by the end user so i have to fetch them from database only...there is no compulsion to use onlu telerik control.....I can use other controls also ...I refer many link but none of them are of use as they all were based on representation of static images...
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 13 Jan 2014 Link to this post

    Hi,

    If the handler is not hit then the URLs that are constructed are wrong and you need to inspect and fix them.

    We offer the RadBinaryImage control that can show binary data from a datasource as an image and, as we already discussed, you may need to upgrade your RadControls version to get it.

    On other options - I am afraid I am not in a position to advise on other third-party software.

    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
Back to Top