repeater嵌套checkbox—大分类选中 他的所属都选中
来源:互联网 发布:ubuntu14.04卸载软件 编辑:程序博客网 时间:2024/05/22 14:15
前台vb
<asp:Repeater id="rptMainMenu" runat="server">
<HeaderTemplate>
<table id="table01" width="149" border="0" cellspacing="0" cellpadding="0">
</HeaderTemplate>
<ItemTemplate>
<tr class ="tr" >
<td id="tdManiMenu" >
<asp:CheckBox ID ="cbxAll" runat ="server" Text ='<%# DataBinder.Eval(Container.DataItem, "标题") %>'oncheckedchanged="ItemCheckBox_CheckedChanged" AutoPostBack="true" Font-Bold ="true" ></asp:CheckBox>
</td>
</tr>
<tr class ="tr">
<td id="tdMenuBorder">
<div>
<asp:Repeater id="rptMainDetail" runat="server">
<ItemTemplate>
<tr>
<td style =" padding-left :10px">
<asp:CheckBox ID="cbxMenuDetail" runat="server" Font-Size ="small" Text ='<%# DataBinder.Eval(Container.DataItem, "标题") %>'
></asp:CheckBox>
<asp:HiddenField runat ="server" ID ="hidValue" Value ='<%# DataBinder.Eval(Container.DataItem, "ID") %>' />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</div>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
后台vb
Protected Sub ItemCheckBox_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim i As Integer = 0
Dim j As Integer = 0
For i = 0 To Me.rptMainMenu.Items.Count - 1
Dim cbxAll As CheckBox = rptMainMenu.Items(i).FindControl("cbxAll")
Dim rptMenuDetail As Repeater = Me.rptMainMenu.Items(i).FindControl("rptMainDetail")
If sender.Equals(cbxAll) Then
Dim rptMenuDetail As Repeater = Me.rptMainMenu.Items(i).FindControl("rptMainDetail")
For j = 0 To rptMenuDetail.Items.Count - 1
Dim cbxMenuDetail As CheckBox = rptMenuDetail.Items(j).FindControl("cbxMenuDetail")
cbxMenuDetail.Checked = cbxAll.Checked
Next
End If Next
End Sub
但是有没有方法可以再前台js中控制的,有的话还请分享下
- repeater嵌套checkbox—大分类选中 他的所属都选中
- 获取repeater 中 checkbox 选中的值
- asp.net中使用Repeater嵌套,提交选中的checkbox项。
- 解决listView嵌套CheckBox的选中错乱
- 保存Repeater控件中input CheckBox的选中状态
- radio 选中和取Repeater里的CheckBox未选中的值
- 使用repeater控件时,得到选中checkbox
- easyui datagrid组件 单击行 让他不选中 只有单击checkbox的时候才选中
- easyui datagrid组件 单击行 让他不选中 只有单击checkbox的时候才选中
- 让checkbox不选中即将选中的checkbox不选中
- radio,checkbox的选中
- checkbox选中的问题
- 获取选中的checkbox
- Repeater行绑定样式,选中checkbox,获取checkbox的ToolTip值
- android checkBox 的选中和取消选中
- asp.net Repeater取得CheckBox选中的某行某个值的c#写法
- checkbox 选中?
- checkBox选中
- PHP中数组合并的两种方法及区别介绍
- 华夏互联五周年志与纪念品展示
- 骆驼祥子
- 图片的多种展示效果,及图片的拖动,缩放
- 树和二叉树2——遍历
- repeater嵌套checkbox—大分类选中 他的所属都选中
- 算法竞赛入门经典第1章【小结与习题】
- C# AD登入验证
- CFileDialog 的unhandled exception at
- 南昌公司荣获双软认证
- Unicode 解析
- cxf处理所有情况的参数传递
- 关于spring 与rmi整合简单例子详解
- 这个位置是留给你的-From 我知女人心