首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

CheckboxList平添Value属性

2012-06-21 
CheckboxList添加Value属性CheckboxList添加Value属性.公司框架的取值结构是:C# codeasp:CheckBoxList ID

CheckboxList添加Value属性
CheckboxList添加Value属性.

公司框架的取值结构是:

C# code
<asp:CheckBoxList ID="checkList_Emp_Other" runat="server" RepeatDirection="Horizontal"><asp:ListItem Value="0" alt="0">厂服</asp:ListItem><asp:ListItem Value="1" alt="1">门卡</asp:ListItem></asp:CheckBoxList>

alt:后面跟的是value的值.
生成的HTML:
HTML code
<table id="checkList_Emp_LabourGoods" border="0">    <tr>        <td><span alt="0"><input id="checkList_Emp_LabourGoods_0" type="checkbox" name="checkList_Emp_LabourGoods$0" /><label for="checkList_Emp_LabourGoods_0">厂服</label></span></td><td><span alt="1"><input id="checkList_Emp_LabourGoods_1" type="checkbox" name="checkList_Emp_LabourGoods$1" /><label for="checkList_Emp_LabourGoods_1">门卡</label></span></td>    </tr></table>


现在我需要做动态绑定.生成出的html是没有value值的.也没有上面的span标签.
如何才能动态绑定后让其结构和以上HTML一致.求解..



[解决办法]
C# code
        <asp:CheckBoxList ID="checkList_Emp_Other" runat="server" RepeatDirection="Horizontal">            <asp:ListItem Value="0" alt="0">厂服</asp:ListItem>            <asp:ListItem Value="1" alt="1">门卡</asp:ListItem>        </asp:CheckBoxList> 

热点排行