日期:2014-05-18 浏览次数:20456 次
foreach (DataListItem di in DataList1.Items) { CheckBox cb = new CheckBox(); DataList ds = (DataList)di.FindControl("DataList2"); //for (int i = 0; i < ds.Items.Count;i++ ) foreach (DataListItem dli in ds.Items) { cb = ((CheckBox)ds.FindControl("CheckBox1")); if (cb.Checked) { //string id = ds.DataKeys[] ; 取选中的主键 } ...... } }