title: Add a clickable image to a GridView in ASP.Net
body: <p>I'm trying to add an delete image at the end of each row in a GridView. I want the user to be able to click the image to delete the row.</p>
  
  <p>So I've used a HyperLinkField to create a link to another page which will delete the record:</p>
  
  <pre><code>&lt;asp:HyperLinkField DataNavigateUrlFields="ID" 
                          DataNavigateUrlFormatString="RemoveLine.aspx?ID={0}"                             
                          Target="_blank"   /&gt;
  </code></pre>
  
  <p>The HyperLinkField doesn't contain an Image tag so I created a TemplateField with an Image inside.</p>
  
  <pre><code>&lt;asp:TemplateField&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:Image ID="imageRemove" runat="server" ImageUrl="~/Images/smallcross.gif"  /&gt;                                
      &lt;/ItemTemplate&gt;                        
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>However the HyperLinkField and Image appear in different columns and the image has no click event. </p>
  
  <p>Any way of combining the two?</p>
  
  <p>I'm using ASP.Net 4.0.</p>
  
  <p>Thanks in advance</p>