Sub Button1_Click(sender As Object, e As EventArgs)
Dim chkCusID As CheckBox
Dim lblID As Label
Dim i As Integer
lblText.Text = ""
For i = 0 To myListView.Items.Count - 1
chkCusID = myListView.Items(i).FindControl("chkCustomerID")
lblID = myListView.Items(i).FindControl("lblCustomerID")
IF chkCusID.Checked = True Then
'*** Have lblID.Text ***'
Me.lblText.Text = Me.lblText.Text & "<br>" & lblID.Text
End IF
Next
End Sub
Sub btnDelete_OnClick(sender As Object, e As EventArgs)
Dim chkDel As CheckBox
Dim lblID As Label
Dim i As Integer
For i = 0 To myRepeater.Items.Count - 1
chkDel = myRepeater.Items(i).FindControl("chkDel")
lblID = myRepeater.Items(i).FindControl("lblCustomerID")
IF chkDel.Checked = True Then
strSQL = "DELETE FROM customer WHERE CustomerID = '"& lblID.Text &"' "
objCmd = New SqlCommand(strSQL, objConn)
objCmd.ExecuteNonQuery()
End IF
Next
BindData()
End Sub