当前位置:首页 > Web开发 > 正文

E:\ASP.net\temp\WebSite1 CheckBox2控件的 AutoPostBack属性设置为true

2024-03-31 Web开发

E:\ASP.net\temp\WebSite1

CheckBox2控件的 AutoPostBack属性设置为true.

protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
   for(int i=0;i<=GridView1.Rows.Count-1;i++)
    {
       CheckBox chk = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");
           if (CheckBox2.Checked == true)
            {
              chk.Checked = true;
            }
         else
          {
              chk.Checked = false;
          }
    }
}

ASP.net:GridView控件中实现全选和全反选

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/31764.html