How can I do events in a checkBox set that I am creating, that is, I have my code:
for (int i = 1; i < NcheckBox; i++)
{
CheckBox cbxN = new CheckBox();
cbxN.Text = nameCheckbox[i];
cbxN.AutoPostBack = true;
cbxN.CheckedChanged += new EventHandler(cbxN_CheckedChanged);
divcbxCompatibilidad.Controls.Add(cbxN);
}
protected void cbxN_CheckedChanged(object sender, EventArgs e)
{
}
<div id="divcbxCompatibilidad" runat="server" class="divcbx"></div>
and I need to fire the event cbxN_CheckedChanged
when some CheckBox
is selected but I only get the page refreshed from page_Load
.