js全选功能

         function  CheckAll()
        {
            
for ( var  i  =   0 ; i  <  document.form1.commentid.length; i ++ )
            {
                
if (document.form1.commentid[i].checked  ==   false )
                document.form1.commentid[i].checked 
=   true ;
                
else
                document.form1.commentid[i].checked 
=   false ;
            }
        }

 

< input  type ="button"  name ="checkAll"  value ="选中本页所有项"  onclick ="CheckAll();"   class ="inputbut" />

 

1.放在Repeater控件中使用:

 

< asp:Repeater  ID ="rptMsgList"  runat ="server" >
< ItemTemplate >
< dt  class ="dt" >
< input  type ="checkbox"  name ="commentid"  id ="commentid"   value ="<%#Eval(" id") % > " />
< img  src ="../images/pic/icon.jpg"  alt =""   />
                                
<% --< span class = " msgtitle " > # < %# _rsCount  +   1   -  (Container.ItemIndex  +   1   +  _PageSize  *  (page  -   1 ))  %> &nbsp; </ span > --%>
</ dt >
< dt  class ="dd" >
<% #NT.Common.NTString.toHtml( Eval ( " msgcontent " ).ToString()) %>
</ dt >
</ ItemTemplate >
</ asp:Repeater >

 

2.后台cs获取:

 

     protected   void  btnPass_Click( object  sender, EventArgs e)
    {
        
bool  brt  =   false ;
        
string [] commentids  =  Request[ " commentid " ].Split( new   char [] {  ' , '  }, StringSplitOptions.RemoveEmptyEntries);
        
foreach  ( string  id  in  commentids)
        {
            brt
= comment.CommentCheck(Convert.ToInt32(id));
        }

        DisPlayCommentList();
    }

 

转载于:https://www.cnblogs.com/cancer_xu/archive/2009/11/24/1609741.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值