Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CreateChildControls() when adding controls programmatically

Thread Tools

CreateChildControls() when adding controls programmatically
Posts: n/a
Righto, a problem with programmatically created controls.

Well, in that kind of area anyway. I'm creating and adding controls to
my page using TemplateControl.LoadControl quite successfully, but I
have a button on my page that adds another control (it's a row of a
table in a timesheet application).

Trouble is, of course, CreateChildControls() is called before
AddProject(), which is the method that adds another row to the table. I
could add this row to the table in AddProject(), but that seems to be
moving the logic of creating controls out of the CreateChildControls()
method where it belongs; or am I just being pedantic?

Have looked at the page lifecycle documentation in the MSDN stuff, but
there's no real explanation of how to handle this kind of thing.

Any explanations, or preferably links, would be greatly appreciated.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Controls Programmatically Chakravarti Mukesh ASP .Net 3 02-14-2013 08:39 AM
Adding server controls programmatically(Noob Question) missinghyperlink text ASP .Net 4 01-16-2008 05:59 AM
When adding controls programmatically... Rob Meade ASP .Net 3 05-15-2007 12:46 PM
Adding controls programmatically. Tim Marsden ASP .Net 2 05-25-2004 03:33 AM
Adding validation controls programmatically =?Utf-8?B?RCBTaGVsZG9u?= ASP .Net 2 05-11-2004 07:16 PM