I can’t see CheckBoxList control in browser.The visible property is set to true.
Here my ASP code:
<'asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True">
<'/asp:CheckBoxList>
here is code behind (I set a brake point near CheckBoxList1_PreRender,but in debug mode this event was ignored!!! ):
protected void CheckBoxList1_PreRender(object sender, EventArgs e)
{
var ColorList = BL.FooBL.GetColorList();
foreach (var item in ColorList)
{
CheckBoxList1.Items.Add(new ListItem(item.ColorName, item.ColorID.ToString()));
}
}
All other control I see in debbug mode on page except CheckBoxList1 control.
what may be the problem?
Thank you in advance.
The event doesn’t fire because it isn’t wired up. You can do this in code with the following:
Automatic event wire up only works for the page events.