|
楼主 |
发表于 2020-5-12 06:15:01
|
显示全部楼层
protected void CheckAll(object sender, EventArgs e)
{
CheckBox cbx = (CheckBox)sender;
string checkstr;
foreach (GridViewRow gvr in gvComUnion.Rows)
{
CheckBox ch = (CheckBox)gvr.FindControl("ItemCheckBox");
//ch.Checked = cbx.Checked;
if (ch != null)
{
checkstr += string.Format(";document.all['{0}'].checked=true", ch.ClientID);
}
}
Page.RegisterStartupScript("key1", string.Format("<script>{0}</script>", checkstr));
}
是这样吗?不行啊 |
|