title: dynamically add linkbutton to asp.net page vb
body: <p>I'm trying to programatically add some link buttons to a page. </p>
  
  <p>I'm trying to follow an example that I've seen online but can't get it to work.</p>
  
  <p>I want the linkbutton to call a sub e.g. download_file(,)</p>
  
  <p>As an example what I have is:</p>
  
  <pre><code>            Dim lb = New LinkButton()
              lb.CausesValidation = True
              lb.Attributes.Add("runat", "server")
              lb.CommandName = "lb_Click"
              lb.CommandArgument = "test"
              lb.Text = reader("filename")
              lb.EnableViewState = True
              lb.Enabled = True
  
              AddHandler lb.Click, AddressOf download_file
  
              Panel1.Controls.Add(lb)
  </code></pre>
  
  <p>Getting the button(s) to appear would be a start! Also, do I need to put them on a panel?</p>
  
  <p>Any ideas?</p>