在Repeater里面的使用CheckBox 的问题

YY_StartGO YY_StartGO 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="rep_table">
<tr class="rep_alternating">
<th class="rep_td" style="width:50px" >
<asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged"/></th>
<th class="rep_td">
序号</th>
<th class="rep_td">
用户名称</th>
<th class="rep_td">
用户账号</th>
<th class="rep_td">
联系电话</th>
<th class="rep_td">
EMAIL</th>
<th class="rep_td">
用户类型</th>
<th class="rep_td">
操作</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr onmouseover="rep_mo(this)" onmouseout="rep_mout(this,true)" class="rep_normal">
<td>
<asp:CheckBox ID="CheckBox2" runat="server" /> </td>
<td class="rep_td" align="center" style="width:50px">
 <%# Eval("VC_ID")%>
</td>
<td class="rep_td" align="left" style="width:300px">
 <%# Eval("VC_YHMC")%>
</td>
<td class="rep_td" align="left" style="width:150px">
 <%# Eval("VC_YHZH")%>
</td>
<td class="rep_td" align="left" style="width:160px">
 <%# Eval("VC_LXDH")%>
</td>
<td class="rep_td" align="left" style="width:160px">
 <%# Eval("VC_EMAIL")%>
</td>
<td class="rep_td" align="center" style="width:160px">
 <%# Eval("I_LX")%>
</td>
<td class="rep_td" align="left" style="width:160px">
 <a href="mod_userinfor.aspx?id=<%# Eval("VC_ID")%>" target="_self"><img src="../img/edit.gif" style="text-decoration:none;color:#000000;border:0;" alt=""/></a> 
<a href="#"><img src="../img/default_set.gif" style="text-decoration:none;color:#000000;border:0;" alt=""/></a>
</td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr onmouseover="rep_mo(this)" onmouseout="rep_mout(this,false)" class="rep_alternating">
<td>
<asp:CheckBox ID="CheckBox2" runat="server" /> </td>
<td class="rep_td" align="center" style="width:50px">
 <%# Eval("VC_ID")%>
</td>
<td class="rep_td" align="left" style="width:300px">
 <%# Eval("VC_YHMC")%>
</td>
<td class="rep_td" align="left" style="width:150px">
 <%# Eval("VC_YHZH")%>
</td>
<td class="rep_td" align="left" style="width:160px">
 <%# Eval("VC_LXDH")%>
</td>
<td class="rep_td" align="left" style="width:160px">
 <%# Eval("VC_EMAIL")%>
</td>
<td class="rep_td" align="center" style="width:160px">
 <%# Eval("I_LX")%>
</td>
<td class="rep_td" align="left" style="width:160px">
 <a href="mod_userinfor.aspx?id=<%# Eval("VC_ID")%>" target="_self"><img src="../img/edit.gif" style="text-decoration:none;color:#000000;border:0;" alt=""/></a> 
<a href="#"><img src="../img/default_set.gif" style="text-decoration:none;color:#000000;border:0;" alt=""/></a>
</td>
</tr>
</AlternatingItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>



当我选中CheckBox1的时候checkbox2 如何全部选中了啊(就是全选 checkbox1是总选,checkbox2是每条信息选中 )

我用CheckBox1_CheckedChanged 事件 好像是找不到 checkbox2的ID

checkbox2 有很多 我选中它又如何得到它的值(ID)啊? 因为我还要删除
在Repeater里面的使用CheckBox 我用的很少 不太清楚啊!
...全文
评论 15
收藏 已收藏
分享
返回顶部
YY_StartGO
.NET社区 62,273 成员 668,968 内容