I am using a CheckBox like this:
<asp:CheckBox ID="cbCode" runat="server" OnCheckedChanged="cbCode_CheckedChanged" />
protected void cbCode_CheckedChanged(object sender, EventArgs e)
{
if (!Convert.ToBoolean(cbCode.Checked))
{
}
else
{
}
}
The event is not firing and I'm unable to find out what is missing.
您需要在复选框上使用AutoPostBack="True"
。
您可以在updatepanel的内容下方为复选框选中更改添加触发器。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.