Dynamic Template Repeater Find Control
I need to find a control(Checkbox) that is contained in a template for a repeater.
I moved the itemtemplate to an ASCX file and then call it by
repOrders.ItemTemplate = Page.LoadTemplate("Item.ascx")
I used to have the itemtemplate coded at design time and then after submitting the form I used to check the value of the check boxes by doing
For a = 0 To repOrders.Items.Count - 1
'Loop though Orders to see if any are checked
checkbox = repOrders.Items(a).FindControl("CheckFlag")
etc
However now that I have moved the itemtemplate to an ASCX i can no longer find the control "CheckFlag"
I have an incling what it could be but no means of knowing how to get there. The actual HTML produced by the ASCX dynamic template is
<input id="repOrders__ctl1__ctl0_CheckFlag" type="checkbox" name="repOrders:_ctl1:_ctl0:CheckFlag" />
And the old design time template produced
<input id="repOrders__ctl1_CheckFlag" type="checkbox" name="repOrders:_ctl1:CheckFlag" />
There is some kind of extra "ctl" which i presume means control level.
How could i access the "CheckFlag" control using the dynamic Itemtemplate.
Any help appreciate because I losing will to live.
Cheers
Zac
|