M
mark.norgate
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.
Mark
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.
Mark