protected string Get反选脚本
{
get
{
string scp = "var ids=[";
foreach (GridViewRow r in this.GridView1.Rows)
{
CheckBox ch = (CheckBox)r.FindControl("chbSelectRow");
if (ch != null)
scp += "'" + ch.ClientID + "',";
}
scp += "''];for(i=0;i<ids.length-1;i++) {var obj=document.getElementById(ids[i]);obj.checked=!obj.checked;};";
return scp;
}
}
protected string Get全选脚本
{
get
{
string scp = "var ids=[";
foreach (GridViewRow r in this.GridView1.Rows)
{
CheckBox ch = (CheckBox)r.FindControl("chbSelectRow");
if (ch != null)
scp += "'" + ch.ClientID + "',";
}
scp += "''];for(i=0;i<ids.length-1;i++) {var obj=document.getElementById(ids[i]);obj.checked=true;};return false;";
return scp;
}
}