Repeat 中的CheckBox不起作用,点更新为什么会全部更新啊?
Private Sub btndelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndelete.ClickDim i As Integer
For i = 1 To Repeater1.Items.Count - 1
Dim cb As CheckBox = Repeater1.Items(i).FindControl("CheckBox1")
If Not cb Is Nothing And cb.Checked = True Then
Dim strsql As String = "update maillist set MFlag='d' where mfrom=(select defaultmail from users where username=" & "'" & Session("username") & "'" & ")" & ""
Dim cmd As New SqlCommand(strsql, conn)
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
End If
Next
End Sub