小弟新手 求教各位大侠!!!不要笑话小弟 怎样判断datalist里面没有radiobutton
当没有找到RadioButtonList1时跳出循环
bc=0
For Each a1 As DataRow In row1
bc += 1
If DataList1.Items(bc - 1).FindControl("RadioButtonList1")这里应该怎么写 Then
Exit For
Else
.........
[解决办法]
你要知道RadioButtonList控件的id,那你可以用FindControl来查找
如果不知道id,则需要循环
for each c as control in DataList1.Items(bc - 1).controls
if c is RadioButtonList then
exit for
end if
next