2012-07-29 84 views
0

我有一個dataGrid顯示人員列表。dataGrid不顯示圖像

的問題是,DataGrid不顯示圖像它的diplayed像這樣的人:

System.Byte[]. 
+0

Win or web?贏 - 添加一個知道如何顯示圖像的控件。網頁 - 添加一個img標籤並設置網址。 – 2012-07-29 23:17:47

+0

這是贏了..但我怎麼能這樣做? – 2012-07-29 23:44:43

+0

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/c17ee134-0021-49ec-ab6b-37adbb2ff58b/ – 2012-07-29 23:52:14

回答

0

您可以創建HTTP處理程序(ashx的),您可以編寫代碼用來顯示圖像響應標題,然後使用像下面的處理程序來顯示圖像

<asp:Repeater ID="repeater1" runat="server">  
     <ItemTemplate>   
      <img src="displayImage.ashx?id=111" style="text-align:center"/> 
     </ItemTemplate> 
    </asp:Repeater> 
+0

我使用Win apllication而不是web應用程序 – 2012-07-30 15:04:59