asp.net中gridview、datalist、datagrid三个数据控件的foreach遍历方法
摘要:
gridview遍历如下: foreach (GridViewRow row in GridView1.Rows){ CheckBox cb = (CheckBox)row.FindControl("CheckBox2"); if(cb.Checked==true) {} }datagrid遍历:foreach(DataGridItem oItem in ItemsGrid.Items){ CheckBox ck1 = (CheckBox)oItem.FindControl("CheckBox"); if(ck1.Checked == true) {}} 阅读全文
posted @ 2011-05-18 09:18 悟生慧 阅读(2064) 评论(0) 推荐(0) 编辑