Repeater控件html如下:
<asp:Repeater ID="RT" runat="server">
<ItemTemplate>
<asp:CheckBox ID="cbResDept" runat="server" />
<asp:Label ID="lblResDept" runat="server" Text=' <%#Eval("dname")%>'></asp:Label>
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="RT" runat="server">
<ItemTemplate>
<asp:CheckBox ID="cbResDept" runat="server" />
<asp:Label ID="lblResDept" runat="server" Text=' <%#Eval("dname")%>'></asp:Label>
</ItemTemplate>
</asp:Repeater>
解决方案 »
- 请问可以在页面开发(包括前后台)完成后,再由美工做界面美化吗?
- ***紧急***有人做过直接跟银行的支付接口吗(农行,交行)
- vs2008专业版安装提示cab15.cab数字签名无效?
- linkbutton和button
- 怎么在GridView控件里点击RadioButtonList后,改变另一个Button控件的属性
- DataView 单页显示数据超过1000条时,速度奇慢,可有办法解决。
- 如何实现无刷新的DropdownList联动效果(几天了啊,马上给分)
- 求教ASP.NET MVC4结合ajax登录Action中如何返回一个true
- 如何用程序隐藏和显示DataGrid中的一列
- 新人求助,asp.net邮件接收怎么弄?
- B/S开发,有什么好的工作流,大家推荐下
- 未能加载程序集“App_Web_fi9vgdya”。请确保在访问该页之前已经编译了此程序集。
2 {
3 HtmlInputCheckBox check = (HtmlInputCheckBox)c.FindControl("chkSelect");
4 if( check != null )
5 {
6 check.Checked = true;
7 }
8 }
2 {
3 HtmlInputCheckBox check = (HtmlInputCheckBox)this.Repeater1.Items[i].FindControl("chkSelect");
4 if( check != null )
5 {
6 check.Checked = true;
7 }
8 }
1 foreach( RepeaterItem item in this.Repeater1.Items )
2 {
3 HtmlInputCheckBox check = (HtmlInputCheckBox)item.FindControl("chkSelect");
4 if( check != null )
5 {
6 check.Checked = true;
7 }
8 }
{
var a=document.getelementbyid('repeat1').getelementsbytag("checkbox");
for(var i in a)
{
i.checked=true;
}
}
大概这样具体试下了.
var arr = $id("<%=repeater1.ClientID %>").getElementsByTagName("input");
for(var i=0;i<arr.length;i++)
{
if(arr[i].type == "checkbox")
{
if(i==0) chk = arr[i].checked;
arr[i].checked = !chk;
}
}
var items = document.getElementById("<%=RT.ClientID %>").getElementsByTagName("input");
var hidNumItems = "";
for (var i = 0; i < items.length; i++) {
var a = items[i].type;
if (items[i].type == "checkbox" && items[i].value != "all") {
items[i].checked = obj.checked;
hidNumItems = hidNumItems + items[i].value + ',';
}
}
<input type="chechbox" value="1" name="selectValue" /><label>向晶</label>
<input type="chechbox" value="3" name="selectValue" /><label>其他</label>
<input type="chechbox" value="2" name="selectValue" /><label>好多</label>这样 可以先用 var tb=document.getElementByID("table") //如果check 在table 下面 就这样,如果没有 直接获取它的NAME
var chk=tb.getElementByTanName("input")
var str="";
for(var i=0;i<chk.length;i++)
{
var ta= chk[i].nextSibling //chechbox的下一个节点
str+=ta.innerText;
}
<input type='hidden' name='hid_name' value='"+str+"' /> 用hidden 接收 后台reque.from["hid_name"]获取
在VS2010里面,这个第一句定义的话就不对!