I want to control the value of each row in repeater in order to change image if the value is different. My problem is that I cannot get value from repeater by trying to get of data each rows(). How can I solve it?
for (int i = 0; i < repeater_talepler_list.Items.Count; i++)
{
ImageButton ib=(ImageButton)repeater_talepler_list.Controls[4].Controls[0].FindControl("islemeAlButton");
bool res = CheckTalep(id, User_Name);
if (res)
{
ib.ImageUrl = "~/images/confirm.png";
}
}
I guess that you can't find the ImageButton
with repeater_talepler_list.Controls[4].Controls[0].FindControl("islemeAlButton")
.
Use FindControl
on the complete RepeaterItem
instead of a nested control in it:
RepeaterItem item = repeater_talepler_list.Items[i];
ImageButton ib = (ImageButton) item.FindControl("islemeAlButton");