日期:2014-05-18 浏览次数:20459 次
protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { if (CheckBox1.Checked == true) { CheckBox1.Text = "选中"; } else { CheckBox1.Text = "没选"; } }
------解决方案--------------------
CheckBoxList的话这样
前台
<asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True" onselectedindexchanged="CheckBoxList1_SelectedIndexChanged"> <asp:ListItem Value="1">没选</asp:ListItem> <asp:ListItem Value="2">没选</asp:ListItem> <asp:ListItem Value="3">没选</asp:ListItem> <asp:ListItem Value="4">没选</asp:ListItem> </asp:CheckBoxList>