You can do this as follows:
1. For each checkbox set a unique ID (in the ID property of your checkbox
object).
2. Add the same event handler to all the checkbox as follows:
AddHandler newcheck.CheckedChanged, AddressOf check_checked
where newcheck is the name of a checkbox and check_checked is the name of
the method you want the postback event to be posted to.
Apply Steps 1 and 2 for all the checkboxes created.
3. In the check_checked method (the method that handles the event of
checkbox cliecked), read the ID to know which check box was clicked
A small sample for the check_checked method is:
Private Sub check1_checked(ByVal sender As Object, ByVal e As EventArgs)
Response.Write(CType(sender, System.Web.UI.WebControls.CheckBox).ID)
End Sub
Regards
Mohamed El Ashmawy
MEA Developer Support Center
ITWorx on behalf of Microsoft EMEA GTSC
"Steve Caliendo" <sc*******@epion.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
I am dynamically generating check boxes in the Panel control based on a
database field, and I've set the AutoPostBack property to True. How can I
determine which CheckBox caused the post back ?
Thank you,
Steve