Ask a Question related to ASP.NET General, Design and Development.
-
George Ter-Saakov #1
CreateChildControls?
Hi.
I have an HTML page were I load controls dynamically.
So I overwrote the CreateChildControl but I found some problem.
First time when page is called the CreateChildControl is called after
Page::Load
But when it's a post back the CreateChildControl is called before
Page::Load.
Is there any reason for that?
George.
George Ter-Saakov Guest
-
Validation before or after CreateChildControls
Hi all, I have a composite control which is basically a wrapper control for child controls and validators. It's a little hacky, but I could... -
Use CreatechildControls in asp.net 2.0 page
Hi I have a page that that loads most of its controls dynamiclly(usercontrols). Is it make sence to add them to the page in CreateChildControls?... -
Event Fires after CreateChildControls
I have created a C# control that creates its objects within CreateChildControls. One of those objects is a button which I have attached to a... -
CreateChildControls not being called
Has anybody ever seen a situation in a custom control where CreateChildControls is not being called? I've set a break point in the method and it is... -
What if you don't know your kids in CreateChildControls?
Hi Mark, You always create your child controls in CreateChildControls. What you have to do is to recreate your childs after the click event... -
William F. Robertson, Jr. #2
Re: CreateChildControls?
The CreateChildControls is called in a composite control before the child
controls are needed. The child controls more than likely need to processes
some postback data ( or events ) and thus, they are required to be around
before the page load.
It shouldn't matter when the CreateChildControls is being called as far as
the behavior of your composite control, but I would definitely consider
adding EnsureChildControls() before every method or property that access the
child controls and don't concern your self of the "first" time it is called.
HTH,
bill
"George Ter-Saakov" <we@hotmail.com> wrote in message
news:ef5vbmQVDHA.2024@TK2MSFTNGP12.phx.gbl...> Hi.
> I have an HTML page were I load controls dynamically.
>
> So I overwrote the CreateChildControl but I found some problem.
> First time when page is called the CreateChildControl is called after
> Page::Load
> But when it's a post back the CreateChildControl is called before
> Page::Load.
>
>
> Is there any reason for that?
>
>
> George.
>
>
William F. Robertson, Jr. Guest
-
George Ter-Saakov #3
Re: CreateChildControls?
Thanks.
Did not know that this method existed.
George.
"William F. Robertson, Jr." <wfrobertson@kpmg.com> wrote in message
news:ejWNLESVDHA.2248@TK2MSFTNGP10.phx.gbl...processes> The CreateChildControls is called in a composite control before the child
> controls are needed. The child controls more than likely need tothe> some postback data ( or events ) and thus, they are required to be around
> before the page load.
>
> It shouldn't matter when the CreateChildControls is being called as far as
> the behavior of your composite control, but I would definitely consider
> adding EnsureChildControls() before every method or property that accesscalled.> child controls and don't concern your self of the "first" time it is>
> HTH,
>
> bill
>
>
>
> "George Ter-Saakov" <we@hotmail.com> wrote in message
> news:ef5vbmQVDHA.2024@TK2MSFTNGP12.phx.gbl...>> > Hi.
> > I have an HTML page were I load controls dynamically.
> >
> > So I overwrote the CreateChildControl but I found some problem.
> > First time when page is called the CreateChildControl is called after
> > Page::Load
> > But when it's a post back the CreateChildControl is called before
> > Page::Load.
> >
> >
> > Is there any reason for that?
> >
> >
> > George.
> >
> >
>
George Ter-Saakov Guest
-
William F. Robertson, Jr. #4
Re: CreateChildControls?
I can type the EnsureChildControls() really fast since I use it about 4000
times in each of my controls. Typically on the properties for the composite
controls.
happy coding.
bill
"George Ter-Saakov" <we@hotmail.com> wrote in message
news:OzGvxeSVDHA.2236@TK2MSFTNGP10.phx.gbl...child> Thanks.
> Did not know that this method existed.
>
> George.
>
> "William F. Robertson, Jr." <wfrobertson@kpmg.com> wrote in message
> news:ejWNLESVDHA.2248@TK2MSFTNGP10.phx.gbl...> > The CreateChildControls is called in a composite control before thearound> processes> > controls are needed. The child controls more than likely need to> > some postback data ( or events ) and thus, they are required to beas> > before the page load.
> >
> > It shouldn't matter when the CreateChildControls is being called as far> the> > the behavior of your composite control, but I would definitely consider
> > adding EnsureChildControls() before every method or property that access> called.> > child controls and don't concern your self of the "first" time it is>> >
> > HTH,
> >
> > bill
> >
> >
> >
> > "George Ter-Saakov" <we@hotmail.com> wrote in message
> > news:ef5vbmQVDHA.2024@TK2MSFTNGP12.phx.gbl...> >> > > Hi.
> > > I have an HTML page were I load controls dynamically.
> > >
> > > So I overwrote the CreateChildControl but I found some problem.
> > > First time when page is called the CreateChildControl is called after
> > > Page::Load
> > > But when it's a post back the CreateChildControl is called before
> > > Page::Load.
> > >
> > >
> > > Is there any reason for that?
> > >
> > >
> > > George.
> > >
> > >
> >
>
William F. Robertson, Jr. Guest



Reply With Quote

