zoukankan      html  css  js  c++  java
  • 种方式遍历repeater中的CheckBox全选

    方式1:

    foreach (Control c in this.Repeater1.Controls)
       
    {
        HtmlInputCheckBox check 
    = (HtmlInputCheckBox)c.FindControl("cbDelete1");
        
    if( check != null )
        
    {
         check.Checked 
    = true;
        }


       }


    方式2:

    for (int i=0;i<this.Repeater1.Items.Count;i++)
       
    {
        HtmlInputCheckBox check 
    = (HtmlInputCheckBox)this.Repeater1.Items[i].FindControl("cbDelete1");
        
    if( check != null )
        
    {
         check.Checked 
    = true;
        }

       }

    方式3:

    foreach( RepeaterItem item in this.Repeater1.Items )
       
    {
        HtmlInputCheckBox check 
    = (HtmlInputCheckBox)item.FindControl("cbDelete1");
        
    if( check != null )
        
    {
         check.Checked 
    = true;
        }

       }
     
  • 相关阅读:
    HTML
    MySQL 表操作
    MySQL 库操作
    MySQL
    python 客户端的安全性验证和服务端对客户端的多端连接
    python 黏包
    python 通信
    SpringData —— HelloWorld
    JPA
    Hibernate ——二级缓存
  • 原文地址:https://www.cnblogs.com/skyshenwei/p/1652758.html
Copyright © 2011-2022 走看看