int m = 0; //记录被选中的个数 for (int i = 0; i < CheckBoxList1.Items.Count; i++) { if (CheckBoxList1.Items[i].Selected) { m++; } }
function chkDelLength() { var chkLenth = 0; for (i = 0; i < document.getElementsByName("chkDel").length; i++) { if (document.getElementsByName("chkDel")[i].checked) { chkLenth++; } } return chkLenth; }
function getSelCount() { return $('input[id*=checklistboxname][:checked]').length; }
for (int i = 0; i < CheckBoxList1.Items.Count; i++)
{
if (CheckBoxList1.Items[i].Selected)
{
m++;
}
}
function chkDelLength() {
var chkLenth = 0;
for (i = 0; i < document.getElementsByName("chkDel").length; i++) {
if (document.getElementsByName("chkDel")[i].checked) {
chkLenth++;
}
}
return chkLenth;
}
function getSelCount()
{
return $('input[id*=checklistboxname][:checked]').length;
}