我正在创建一个 CheckBoxList 并动态填充它。我单步执行了代码,它似乎并没有命中以下方法,我认为 selected value 属性的值始终为 false。
<form id="form1" action="web_page.aspx">
<asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True"
onselectedindexchanged="CheckBoxList1_SelectedIndexChanged" >
</asp:CheckBoxList>
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="submit"/>
</form>
<div id="p" runat="server"></div>
protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
{
this.p.InnerHtml = "hello";
}