国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

ASP.NET中GridView、DataList、DataGrid三個數(shù)據(jù)控件foreach遍歷用法示例

2024-07-10 12:46:46
字體:
供稿:網(wǎng)友

本文實例講述了ASP.NET中GridView、DataList、DataGrid三個數(shù)據(jù)控件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)  {  }}//datalist遍歷foreach (DateListItem dl in DataList1.Items){  CheckBox cb = (CheckBox)dl.FindControl("CheckBoxID ");  if(cb.checked)  ......}

GridView:

for(int i=0; i <GridView.Rows.Count;i++){   Label lbl = (Label)GridView.Rows[i].FindControl("Label9");}

Repeater:

for(int i=0; i < Repeater.Items.Count;i++){  Label lbl = (Label) Repeater.Items[i].FindControl("Label9");}

DataList:

for(int i=0; i < DataList.Items.Count;i++){  Label lbl = (Label) DataList.Items[i].FindControl("Label9");}

更多關(guān)于asp.net相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《asp.net操作json技巧總結(jié)》、《asp.net字符串操作技巧匯總》、《asp.net操作XML技巧總結(jié)》、《asp.net文件操作技巧匯總》、《asp.net ajax技巧總結(jié)專題》及《asp.net緩存操作技巧總結(jié)》。

希望本文所述對大家asp.net程序設(shè)計有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 舞钢市| 香河县| 鹤岗市| 凤凰县| 绥中县| 普定县| 青浦区| 余江县| 崇信县| 肥乡县| 浪卡子县| 定兴县| 二手房| 中超| 九龙坡区| 微山县| 桑植县| 汝阳县| 三明市| 浦北县| 扬州市| 垫江县| 新竹县| 山阴县| 双辽市| 泌阳县| 金门县| 尉氏县| 松阳县| 彭州市| 喜德县| 定日县| 平塘县| 新竹县| 襄汾县| 成武县| 承德市| 安宁市| 大渡口区| 卫辉市| 巴东县|