You should have something on the code-front that places the control on the page, like:
<uc:CalendarControl ID="dtePrepaymentExpiresDate" FieldName="Prepayment expires date" runat="server" Enabled="false" />
Then in the code behind, you can set this custom property as follows:
dtePrepaymentExpiresDate.Enabled = true;
If you really need to do it in the loop, then you need to cast c
as the CalendarControl
and not UserControl
because CalendarControl
has the property Enabled
while a normal UserControl
does not.
((CalandarControl)c).Enabled = true;