1、C#
for (int i = 0; i < DataGrid1.Items.Count; i++)
{
Response.Write(((LinkButton)DataGrid1.Items[i].Cells[0].Controls[0]).Text + "
");
}
2、VB.net
- For i As Integer = 0 To DataGrid1.Items.Count - 1
- Response.Write(DirectCast(DataGrid1.Items(i).Cells(0).Controls(0), LinkButton).Text + "
") - Next