I have created a simple custom control that uses a table to create space
around its contents. The code in the aspx page is show below. My problem is
that the controls within the template can not be directly accessed from the
code behind. In the code listing below, trying to use "Literal1" control in
the code behind results in a null reference exception. How do I make the
controls within my templated custom control accessible in the code behind?
Thanks
Earl
<cc1:SpacerControl id="SpacerControl1" SpaceAbove="3" SpaceBelow="3"
SpaceRight="100" SpaceLeft="100" WidthInPercent="false" FrameColor="blue"
TableAlign="Center" ContentsWidth="500px" TotalWidth="75%" runat="server">
<ITEMTEMPLATE>
Some Text
<asp:Literal id="Literal1" runat="server"></asp:Literal>
</ITEMTEMPLATE>
</cc1:SpacerControl>