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

首頁 > 編程 > .NET > 正文

asp.net 遍歷repeater中的控件的幾種方式

2024-07-10 13:26:44
字體:
來源:轉載
供稿:網友
方式1:

復制代碼 代碼如下:


foreach (Control c in this.Repeater1.Controls)
{
HtmlInputCheckBox check = (HtmlInputCheckBox)c.FindControl("cbDelete1");
if( check != null )
{
check.Checked = true;
}
}


方式2:

復制代碼 代碼如下:


for (int i=0;i<this.Repeater1.Items.Count;i++)
{
HtmlInputCheckBox check = (HtmlInputCheckBox)this.Repeater1.Items[i].FindControl("cbDelete1");
if( check != null )
{
check.Checked = true;
}
}


方式3:

復制代碼 代碼如下:


foreach( RepeaterItem item in this.Repeater1.Items )
{
HtmlInputCheckBox check = (HtmlInputCheckBox)item.FindControl("cbDelete1");
if( check != null )
{
check.Checked = true;
}
}

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 浮山县| 阿城市| 鹿泉市| 壶关县| 同江市| 凉山| 资兴市| 潼关县| 吴忠市| 曲周县| 武平县| 土默特左旗| 合肥市| 龙海市| 准格尔旗| 旬邑县| 德州市| 通道| 潢川县| 隆尧县| 乐清市| 南雄市| 临夏市| 建平县| 苗栗县| 广平县| 丰原市| 宣威市| 盐源县| 宜丰县| 潞城市| 申扎县| 四会市| 金寨县| 阳城县| 芜湖县| 榆树市| 木里| 鸡泽县| 乌兰县| 怀柔区|