日期:2014-05-20  浏览次数:20497 次

不能在CheckBox 中绑定数据吗
<asp:CheckBox   id= "CheckBox1 "   Text= <%#   DataBinder.Eval(Container.DataItem, "setname ")%>   runat= "server "> </asp:CheckBox>

------解决方案--------------------
没碰到过
------解决方案--------------------
你为什么不在CheckBoxList中绑定呢?
------解决方案--------------------
你是不是在数据绑定的上下文运行的该程序?
------解决方案--------------------
<ItemTemplate>
<asp:CheckBox ID= "DeleteThis " Text= ' <%# DataBinder.Eval (Container.DataItem, "title ") %> ' runat= "server " />
</ItemTemplate>
------解决方案--------------------
<asp:CheckBox ID= "CheckBox1 " runat= "server " Checked= ' <%# Bind( "user_teamid ") %> '/>

<%# Bind( "user_teamid ") %> 是双向绑定,Checked=false/true
------解决方案--------------------
单独的CheckBox不能这样用,
DataGrid,DataList,repeater中的可以
------解决方案--------------------
楼上正解!