W
William Leary
I cannot access a server control that is nested in a
template control...like so:
<dtagageTemplate runat="server" id="myPageTemplate">
<MAINCONTENT><asplaceHolder ID="quoteContent"
runat="server"></asplaceHolder>
</MAINCONTENT>
</dtagageTemplate>
The contents of the MAINCONTENT tag are placed into the
page via the following in the PageTemplate class:
_mainContentContainer = new TemplateItem(this);
MainContent.InstantiateIn(_mainContentContainer);
_mainTableRow5Cell3.Controls.Add(_mainContentContainer);
Everything works great, except for when I'm using
WebControls and trying to access them in the code-behind
page. I cannot access them. I have a variable declared of
type PlaceHolder, but it is always null when I access it.
FindControl using "quoteContent" doesn't work from the
page, of from the myPageTemplate object.
I suspect this has something to do with naming
containers, but very mystified as to how to go about this
at all. Have searched online for several hours now, to
now avail. Any thoughts would be appreciated. Thanks.
template control...like so:
<dtagageTemplate runat="server" id="myPageTemplate">
<MAINCONTENT><asplaceHolder ID="quoteContent"
runat="server"></asplaceHolder>
</MAINCONTENT>
</dtagageTemplate>
The contents of the MAINCONTENT tag are placed into the
page via the following in the PageTemplate class:
_mainContentContainer = new TemplateItem(this);
MainContent.InstantiateIn(_mainContentContainer);
_mainTableRow5Cell3.Controls.Add(_mainContentContainer);
Everything works great, except for when I'm using
WebControls and trying to access them in the code-behind
page. I cannot access them. I have a variable declared of
type PlaceHolder, but it is always null when I access it.
FindControl using "quoteContent" doesn't work from the
page, of from the myPageTemplate object.
I suspect this has something to do with naming
containers, but very mystified as to how to go about this
at all. Have searched online for several hours now, to
now avail. Any thoughts would be appreciated. Thanks.