![]() |
|
|
|||||||
![]() |
ASP Net - is CreateChildControls automatically called within an object OnInit? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
If not is it appropriate to place an EnsureChildControls within an objects
OnInit method? TIA dx |
|
|
|
|
#2 |
|
Posts: n/a
|
Not unless the object is a Composite ASP.Net Server Control.
-- HTH, Kevin Spencer ..Net Developer Microsoft MVP Big things are made up of lots of little things. "dx" <> wrote in message news:-bKdnRIuWsyLEOjdRVn-... > If not is it appropriate to place an EnsureChildControls within an objects > OnInit method? > > TIA > > Kevin Spencer |
|
|
|
#3 |
|
Posts: n/a
|
On initial request (non-postback) EnsureChildControls is called at PreRender
stage of the Page. At postback it is called when postback data handling for the first control occurs, that is when FindControl is called which automatically invokes EnsureChildControls first. This happens before Page_Load at first postback data processing stage. Why would you need this? -- Teemu Keiski MCP, Microsoft MVP (ASP.NET), AspInsiders member ASP.NET Forum Moderator, AspAlliance Columnist http://blogs.aspadvice.com/joteke "dx" <> wrote in message news:-bKdnRIuWsyLEOjdRVn-... If not is it appropriate to place an EnsureChildControls within an objects OnInit method? TIA Teemu Keiski |
|
|
|
#4 |
|
Posts: n/a
|
Thanks Kevin, I appreciate your response. I'm trying to follow you full
circle.. can u help me understand these related questions. Does .NET identify the object as a composite asp.net server control because CreateChildControls is overriden? or because the objects inherits from webcontrol? If not, how does .NET know this object is a composite control? And what kicks off the OnInit call for the composite control? Thanks again, stan "Kevin Spencer" <> wrote in message news:... > Not unless the object is a Composite ASP.Net Server Control. > > -- > HTH, > Kevin Spencer > .Net Developer > Microsoft MVP > Big things are made up > of lots of little things. > > "dx" <> wrote in message > news:-bKdnRIuWsyLEOjdRVn-... > > If not is it appropriate to place an EnsureChildControls within an objects > > OnInit method? > > > > TIA > > > > > > dx |
|
|
|
#5 |
|
Posts: n/a
|
Um...the pattern to build a composite control is that it overrides
CreateChildControls as well as implements INamingContainer marker interface to outcome naming conflicts as well as guide in postback processing. There's not such step as 'recognize' composite control, but rather there are these steps that composite controls usually follow. Article about composite controls: http://aspalliance.com/359 OnInit method is part of general control lifecycle which is called when control reaches initialization stage, true task of OnInit method is to raise Init event. See resources about control lifecycle in this blog posts: http://weblogs.asp.net/eporter/archi.../15/10109.aspx -- Teemu Keiski MCP, Microsoft MVP (ASP.NET), AspInsiders member ASP.NET Forum Moderator, AspAlliance Columnist http://blogs.aspadvice.com/joteke "dx" <> wrote in message news:TZidnfqHuPCQL-jdRVn-... Thanks Kevin, I appreciate your response. I'm trying to follow you full circle.. can u help me understand these related questions. Does .NET identify the object as a composite asp.net server control because CreateChildControls is overriden? or because the objects inherits from webcontrol? If not, how does .NET know this object is a composite control? And what kicks off the OnInit call for the composite control? Thanks again, stan "Kevin Spencer" <> wrote in message news:... > Not unless the object is a Composite ASP.Net Server Control. > > -- > HTH, > Kevin Spencer > .Net Developer > Microsoft MVP > Big things are made up > of lots of little things. > > "dx" <> wrote in message > news:-bKdnRIuWsyLEOjdRVn-... > > If not is it appropriate to place an EnsureChildControls within an objects > > OnInit method? > > > > TIA > > > > > > Teemu Keiski |
|
![]() |
| Thread Tools | Search this Thread |
|
|