0

I am trying to display an image from a database in a repeater control but I am unable to retrieve it.

I used the following code

<div id="photos" class="galleryview">
   <asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource1"> 
      <ItemTemplate>
         <div class="panel"> 
            <img src="<%#Eval("image") %>" /> 
            <div class="panel-overlay"> 
               <p>description: <b><%# Eval("description") %></b><br />
          View full-size photo <a href="<%#Eval("image") %>" target="_blank">here</a>.</p>  
            </div> 
         </div> 
      </ItemTemplate>
   </asp:Repeater> 
   <!-- Strip to display the bottom slideshow. --> 
   <ul class="filmstrip">
      <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"> 
         <ItemTemplate>
            <li><img width="100" height="100" src="<%#Eval("image") %>" alt='<%#Eval("description") %>' title='<%# Eval("category") %>' /></li>
         </ItemTemplate> 
      </asp:Repeater> 
   </ul>
</div>
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

I think the image in your db may be bytecode.You may find a way to make the byte to a image you can see this Retrieve image from database and display on ASP.NET without httphandler

Community
  • 1
  • 1
clijiac
  • 117
  • 3