I want to give a value to a control in asp.net repeater footer template.
Dim FooterTemplate As Control = TicketRepeater.Controls(TicketRepeater.Controls.Count - 1).Controls(0)
Dim lblFooter As Literal = TryCast(FooterTemplate.FindControl("TicketTotalNumberOfTickets"), Literal)
lblFooter.Text = TicketDataTable.Rows.Count.ToString()
Return with error:
Specified argument was out of the range of valid values.
Parameter name: index
AFAIU it cant find count of controls = no controls found?. Any suggestions?
Check points:
- all ID's are correct
- repeater has 3 part headertemplate, itemtemplate, footertemplate
Help!
Update
The code actually work after databind(). Any ideas how to make it work before databind event?