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

