asp.net 遍歷repeater中的控件的幾種方式
更新時間:2010年02月11日 15:01:30 作者:
遍歷repeater中的控件的幾種方式小結(jié),需要的朋友可以參考下。
方式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;
}
}
復(fù)制代碼 代碼如下:
foreach (Control c in this.Repeater1.Controls)
{
HtmlInputCheckBox check = (HtmlInputCheckBox)c.FindControl("cbDelete1");
if( check != null )
{
check.Checked = true;
}
}
方式2:
復(fù)制代碼 代碼如下:
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:
復(fù)制代碼 代碼如下:
foreach( RepeaterItem item in this.Repeater1.Items )
{
HtmlInputCheckBox check = (HtmlInputCheckBox)item.FindControl("cbDelete1");
if( check != null )
{
check.Checked = true;
}
}
您可能感興趣的文章:
- 詳解ASP.NET-----Repeater數(shù)據(jù)控件的用法總結(jié)
- 詳解ASP.NET數(shù)據(jù)綁定操作中Repeater控件的用法
- ASP.NET數(shù)據(jù)綁定之Repeater控件
- asp.net中使用 Repeater控件拖拽實(shí)現(xiàn)排序并同步數(shù)據(jù)庫字段排序
- asp.net使用Repeater控件中的全選進(jìn)行批量操作實(shí)例
- ASP.NET中repeater控件用法實(shí)例
- asp.net Repeater控件的說明及詳細(xì)介紹及使用方法
- asp.net下Repeater使用 AspNetPager分頁控件
- ASP.NET實(shí)現(xiàn)Repeater控件的數(shù)據(jù)綁定
相關(guān)文章
asp.net操作javascript:confirm返回值的兩種方式
asp.net操作javascript:confirm返回值分為兩種,不使用ajax、使用了ajax,不使用ajax,可以用StringBuilder來完成2014-09-09
Asp.net Web Api實(shí)現(xiàn)圖片點(diǎn)擊式圖片驗(yàn)證碼功能
現(xiàn)在驗(yàn)證碼的形式越來越豐富,今天要實(shí)現(xiàn)的是在點(diǎn)擊圖片中的文字來進(jìn)行校驗(yàn)的驗(yàn)證碼。下面通過本文給大家分享Asp.net Web Api實(shí)現(xiàn)圖片點(diǎn)擊式圖片驗(yàn)證碼功能,需要的的朋友參考下吧2017-06-06
.NET?6開發(fā)TodoList應(yīng)用實(shí)現(xiàn)系列背景
這篇文章主要介紹了.NET?6開發(fā)TodoList應(yīng)用實(shí)現(xiàn)系列背景,NET?6是一個很優(yōu)秀的框架,這一點(diǎn)自從我最開始接觸.NET?Core?2起一年一年進(jìn)化到現(xiàn)在,就深切地感受到,那好東西就拿出來和大家分享一下,下面來看一下文章的學(xué)習(xí)介紹吧2021-12-12
win2003服務(wù)器.NET+IIS環(huán)境常見問題排障總結(jié)
在使用iis運(yùn)行asp.net環(huán)境的時候,總是會或多或少的碰到各種各樣的.net運(yùn)行錯誤,這里特別從網(wǎng)絡(luò)整理了下,方便需要的朋友。2011-08-08
asp.net中js+jquery添加下拉框值和后臺獲取示例
這篇文章主要介紹了asp.net中js+jquery添加下拉框值和后臺獲取的具體實(shí)現(xiàn),需要的朋友可以參考下2014-05-05

