2014-02-16 32 views
0

我想在中繼器控件中顯示來自數據庫的圖像,但我無法檢索它。如何從數據庫檢索圖像並將其顯示在中繼器控件中?

我用下面的代碼

<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> 
+0

如何做你上傳圖像,存儲它並保存它的路徑或作爲一個blob? – Wahtever

回答

相關問題