复选框列表不可见
我在浏览器中看不到 CheckBoxList 控件。visible 属性设置为 true。
这是我的 ASP 代码:
<'asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True">
<'/asp:CheckBoxList>
这里是代码隐藏(我在 CheckBoxList1_PreRender 附近设置了一个制动点,但在调试模式下此事件被忽略!!!):
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()));
}
}
我在页面上的调试模式下看到的所有其他控件,除了 CheckBoxList1 控件。
可能是什么问题? 先感谢您。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该事件不会触发,因为它未连接。您可以使用以下代码在代码中执行此操作:
自动事件连接仅适用于页面事件。
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.