M
Marty
I am writing a composite control that has a public method which allows
the addition of more web controls to the custom controls child control
collection. How can I access the value of those new controls within the
code behind file. See example below:
I perform this in the OnInit method. This is a public method with
additional functionality but the concept is add a new controlt to the
composite control.
mycontrol.Add("ControlName", "ControlValue", new TextBox());
However, I cannot access this new control in the designer like:
ControlName.Text because the control is not part of the pages control
collection.
I am not implementing the INamingContainer Interface due to the need to
name each control as it is added.
This is actually doing much more layout and UI layout but the concept
remains the same.
Any pointers how I can access dynamically added controls to a composite
control?
Thanks
Marty
the addition of more web controls to the custom controls child control
collection. How can I access the value of those new controls within the
code behind file. See example below:
I perform this in the OnInit method. This is a public method with
additional functionality but the concept is add a new controlt to the
composite control.
mycontrol.Add("ControlName", "ControlValue", new TextBox());
However, I cannot access this new control in the designer like:
ControlName.Text because the control is not part of the pages control
collection.
I am not implementing the INamingContainer Interface due to the need to
name each control as it is added.
This is actually doing much more layout and UI layout but the concept
remains the same.
Any pointers how I can access dynamically added controls to a composite
control?
Thanks
Marty