title: How do perform a delete on listview that's not bound by a control
body: <p>I have a ListView and I have set up my Delete Link button.  When I clicked Delete however I get <code>"The ListView 'ListView' raised event ItemDeleting which wasn't handled."</code> So I decided to try and implement the <code>DeleteLinkButton_Click()</code> and <code>ListView_ItemDeleted()</code> ... however I can't figure out how to identify which row I've selected for my <code>DeleteLinkButton_Click()</code>. </p>
  
  <p>I didn't bind my source through a control instead I used the following method.</p>
  
  <pre><code>ListView.DataSource = myObject.RetreiveInfo()
  ListView.DataBind()
  </code></pre>
  
  <p>I figure if I can identify my row I can access the values of the labels there and pass them to a stored procedure and perform my DELETE.</p>
  
  <p>Can anyone help?  If I need to provide more code just let me know!</p>
  
  <p>Edit:</p>
  
  <p><strong>CodeBehind</strong></p>
  
  <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
     If Not IsPostBack Then
        UpdateDisplay()
     End If
  End Sub
  
  Protected Sub UpdateDistplay()
      ListView.DataSource = myObject.RetrieveInfo()
      ListView.DataBind()
  End Sub
  </code></pre>
  
  <p><strong>ASPX Page</strong></p>
  
  <pre><code>&lt;ItemTemplate&gt;
    &lt;tr&gt;
        &lt;td&gt;
           &lt;asp:LinkButton ID="DeleteLinkButton" Text="Delete" CommandName="Delete" OnClientClick="return confirm('Delete this Info?')" runat="server"&gt;&lt;/asp:LinkButton&gt;
        &lt;/td&gt;
        &lt;td&gt;
           &lt;asp:Label ID="Name" runat="server" Text='&lt;%# Bind("Name") %&gt;'&gt;&lt;/asp:Label&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/ItemTemplate&gt;
  </code></pre>