1、遍历GridView
foreach (GridViewRow row in GridView1.Rows)
{
string mylable = ((Label)row.FindControl("Label1")).Text;
Response.Write(mylable);
}
2、遍历DataList
foreach (DataListItem dl in this.dlWebSite.Items)
{
CheckBox cb = (CheckBox)dl.FindControl("chbWebSite");
if (cb.Checked)
{
...
}
}