So I am adding check boxes to an HTML page. However, when I try to reference my CheckBox2, I get the error. Here is the checkbox in my html. Default.aspx:
<asp:CheckBox ID="CheckBox1" runat="server" Text="Yes" OnCheckedChanged="CheckBox1_CheckChanged" />
This is no problem at the moment, however the error is thrown here in my "C#" Default.aspx.cs:
protected void CheckBox1_CheckChanged(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
{
CheckBox2.Checked = false;
CheckBox3.Checked = false;
CheckBox4.Checked = false;
CheckBox5.Checked = false;
}
Apparently the check boxes dont exist in the current context, also, double clicking them did not create the event handler, I had to do so myself. Ive looked at many other similar questions and the answers helped everyone else but still none of them have fixed this problem for me
Aucun commentaire:
Enregistrer un commentaire