checkboxlist是复选框的集合,对checkboxlist赋值是没有意义的,要对里面的选
项赋值
checkboxlist1.items.add(new listitem("文本1", "value1"));
checkboxlist1.items.add(new listitem("文本2", "value2"));
核心代码
string strapp = "当前记录,当前页,全部记录,";
string[] strtemp = strapp.split(',');
foreach (string str in strtemp)
{
for (int i = 0; i < cbljl.items.count; i++)
{
if (this.cbljl.items[i].value == str)
{
this.cbljl.items[i].selected = true;
}
}
}
完整实例
<%@ page language=vb debug=true %>
<%@ import namespace="system.data" %>