I was wondering how one would find the controls in the HeaderTemplate or FooterTemplate of an Asp.Net Repeater control.
I can access them on the ItemDataBound event,
Find control into Repeater (Header, Item, Footer)
public static class FindControlInRepeater
{
public static Control FindControl(this Repeater repeater, string controlName)
{
for (int i = 0; i < repeater.Controls.Count; i++)
if (repeater.Controls[i].Controls[0].FindControl(controlName) != null)
return repeater.Controls[i].Controls[0].FindControl(controlName);
return null;
}
}