title: Showing Picture in Asp.Net Image Control From Datalist
body: <p>I am using Asp.Net C# 4.0. I have a Datalist which shows pictures from database. My question is, Is it possible to show pictures in asp.net image control from a datalist upon clicking? The purpose of this operation is to enlarge the picture upon clicking. I am using the following code.</p>
  
  <pre><code>//Here is my ObjectDataSource
  &lt;asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
      SelectMethod="ShowPicBA" TypeName="BusinessAccess.AD_OperationBA"&gt;
      &lt;SelectParameters&gt;
          &lt;asp:QueryStringParameter Name="key" QueryStringField="id" Type="Int64" /&gt;
      &lt;/SelectParameters&gt;
  &lt;/asp:ObjectDataSource&gt;
  
  
  //Here is my DataList
  &lt;asp:DataList ID="DataList1" runat="server" DataSourceID="ObjectDataSource2" 
          DataKeyField="Pic_ID"&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:ImageButton ID="ImageButton1" runat="server" Height="152px"
                  ImageUrl='&lt;%# Eval("Pic_Path") %&gt;' Width="175px"/&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:DataList&gt;
  
  //Here is my Asp.Net Image Control
  &lt;asp:Image ID="Image1" runat="server" /&gt;
  </code></pre>