473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

CreateChildControls() when adding controls programmatically

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

Jun 19 '06 #1
0 1208

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: George Ter-Saakov | last post by:
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...
4
by: Jon | last post by:
Hi! I'm creating a custom Server Control which implements the method in the subject line (Protected override void CreateChildControls) In here I have the following code: LBL myLbl = new...
6
by: Alex | last post by:
I believe that when you instantiate a Control derived custom control that implements the virtual method CreateChildControls(), that that base class constructor in Control calls...
3
by: Arulraja | last post by:
Hello, I have created 2 custom server controls, The parent custom control contains multiple child custom controls. The Child control has a button on it. If I Click the button control, it...
0
by: Ferret | last post by:
I've found what seems to be a nasty bug in the DataGrid and Repeater classes. If CreateChildControls gets called before LoadViewState, ViewState fails to map and you end up with nothing on a...
3
by: Iain | last post by:
In my custom control I have overriden CreateChildControls and the first few lines look like this. protected override void CreateChildControls() { Debug.WriteLine("CreateChildControls",...
1
by: Michael | last post by:
Hi, I'm coding a custom server control, and CreateChildControls() is giving me some pain. I'm just wondering why we have CreateChildControls(), and why this methods seems to be called at...
5
by: Mark Olbert | last post by:
Tonight's episode of me beating my head bloody against the monitor was the result of ViewState/ControlState information not being available when CreateChildControls() gets called for a...
1
by: xke | last post by:
I have a base class which overrides CreateChildControls / Render. Inside CreateChildControls, based on a public property ShowLinks in this class, I can include/display a usercontrol (kind of set of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.