[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

NamingContainer null during page lifecycle

TS

10/3/2008 10:46:00 PM

I am declaratively settting value of custom control in aspx page:
<ctrl:MaskedEditTextBox ID="mskClient_FullPhone"
PropertyID="Client_FullPhone" runat="server" ReadOnly="true"
>929-302-2093</ctrl:MaskedEditTextBox>

This control has a Text property and in side its setter, i am calling ensure
childControls, which creates my child controls in which one of them tries to
access NamingContainer but it and many other properties inherited from
Control are all throwing null exceptions

When in life cycle is it OK to access this?

What options do i have when declaratively setting values like this?



thanks!!!


1 Answer

Teemu Keiski

10/5/2008 10:23:00 AM

0

Hi,

basically Load event is when page and controls should've been loaded. If you
expect postback loading to happen also before, then it would be
LoadComplete.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://aspadvice.com/bl...

"TS" <manofsteele1@nospam.nospam> wrote in message
news:%23JTVInaJJHA.1556@TK2MSFTNGP03.phx.gbl...
>I am declaratively settting value of custom control in aspx page:
> <ctrl:MaskedEditTextBox ID="mskClient_FullPhone"
> PropertyID="Client_FullPhone" runat="server" ReadOnly="true"
> >929-302-2093</ctrl:MaskedEditTextBox>
>
> This control has a Text property and in side its setter, i am calling
> ensure childControls, which creates my child controls in which one of them
> tries to access NamingContainer but it and many other properties inherited
> from Control are all throwing null exceptions
>
> When in life cycle is it OK to access this?
>
> What options do i have when declaratively setting values like this?
>
>
>
> thanks!!!
>
>