title: ASP.Net: why is my button's click/command events not binding/firing in a repeater?
body: <p>Here's the code from the ascx that has the repeater:</p>
  
  <pre><code>&lt;asp:Repeater ID="ListOfEmails" runat="server" &gt;
      &lt;HeaderTemplate&gt;&lt;h3&gt;A sub-header:&lt;/h3&gt;&lt;/HeaderTemplate&gt;
      &lt;ItemTemplate&gt;
          [Some other stuff is here]
          &lt;asp:Button ID="removeEmail" runat="server" Text="X" ToolTip="remove" /&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>And in the codebehind for the repeater's databound and events:</p>
  
  <pre><code>Protected Sub ListOfEmails_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles ListOfEmails.ItemDataBound
      If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType = ListItemType.AlternatingItem) Then
          Dim removeEmail As Button = CType(e.Item.FindControl("removeEmail"), Button)
          removeEmail.CommandArgument = e.Item.ItemIndex.ToString()
  
          AddHandler removeEmail.Click, AddressOf removeEmail_Click
          AddHandler removeEmail.Command, AddressOf removeEmail_Command
      End If
  End Sub
  
  Sub removeEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs)
      Response.Write("&lt;h1&gt;click&lt;/h1&gt;")
  End Sub
  
  Sub removeEmail_Command(ByVal sender As Object, ByVal e As CommandEventArgs)
      Response.Write("&lt;h1&gt;command&lt;/h1&gt;")
  End Sub
  </code></pre>
  
  <p>Neither the click or command is getting called, what am I doing wrong?</p>