Inside my page, I have the following:
<aspe:UpdatePanel runat="server" ID="updatePanel">
<ContentTemplate>
<local:KeywordSelector runat="server" ID="ksKeywords" />
</ContentTemplate>
</aspe:UpdatePanel>
The KeywordSelector
control is a control I define in the same assembly and local
is mapped to its namespace.
The control is made up of several other controls and is defined as such:
<%@ Control Language="C#" AutoEventWireup="true"
CodeBehind="KeywordSelector.ascx.cs"
Inherits="Keywords.KeywordSelector" %>
and has quite a few server controls of its own, all defined as members in the .designer.cs
file.
However, during no part of the control's lifecycle does it have any child control objects nor does it produce HTML:
- All of the members defined in the
.designer.cs
file arenull
. - Calls to
HasControls
returnfalse
. - Calls to
EnsureChildControls
do nothing. - The
Controls
collection is empty.
Removing the UpdatePanel
did no good. I tried to reproduce it in a clean page with a new UserControl
and the same thing happens.
I am using ASP.NET over .NET Framework 3.5 SP1 with the integrated web server.
What am I missing here?
Update #1: Following Rob's comment, I looked into OnInit
and found that the UserControl
does not detect that it has any child controls. Moreover, CreateControlCollection
is never called!