title: Add img to  ahref tag
body: <p>I want the below format to be done from my codebehind:</p>
  
  <pre><code>&lt;a href=""&gt;
  &lt;img src=""/&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I have done this way but I am not able to add image to <code>&lt;a href&gt;</code>
  Can anyone say me how to do that?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Dim urls As New List(Of String)
                  urls.Add("Downloads/" &amp; Session("tempDir").ToString &amp; "/" &amp; filename)
                  For Each imageURL As String In urls
                      Dim img = New System.Web.UI.WebControls.Image()
                      img.ImageUrl = imageURL
                      img.Attributes.Add("src", "Downloads/" &amp; Session("tempDir").ToString &amp; "/" &amp; filename)
                      img.Attributes.Add("rel", "group2")
                      img.Width = 75
                      img.Height = 50
                      img.CssClass = "clickImage"
                      img.ImageAlign = HorizontalAlign.Left
                      Me.FinalPreview.Controls.Add(img)
                  Next
  </code></pre>
  
  <p>I have found this:</p>
  
  <pre><code>Dim anchor As New HtmlGenericControl("a")
  anchor.Attributes.Add("href", "#")
  </code></pre>
  
  <p>But I am not able to understand how do I add img to this If I add control the total img is not showing up.</p>