C
Craig
Hi
I am developing a web control which creates other web controls. During the
OnInit of the my web control I read an Xml file which tells my web control
which child control to create, adding the child controls into a private
collection.
In the CreateChildControls (override) method, I loop through my collection
of child controls, adding them to the web control:
this.Controls.Add(this.Page.ParseControl(childControlCol));
I do not expose any properties of child controls in the web control.
Everything to this point renders as expected to the page. Say for example I
render a TextBox child control from my collection. The user enters a value,
then does a post back. How can I access the value of the TextBox control.
Normally I would do this.Controls[childControlId] or a this.FindControl() but
neither of these actions retrieve the control. In fact no child controls
exist in the web control, I have implemented INamingContainer and my web
control is dereived from Control.
Any ideas on how I can get reference to my child controls after postback?
Craig
I am developing a web control which creates other web controls. During the
OnInit of the my web control I read an Xml file which tells my web control
which child control to create, adding the child controls into a private
collection.
In the CreateChildControls (override) method, I loop through my collection
of child controls, adding them to the web control:
this.Controls.Add(this.Page.ParseControl(childControlCol));
I do not expose any properties of child controls in the web control.
Everything to this point renders as expected to the page. Say for example I
render a TextBox child control from my collection. The user enters a value,
then does a post back. How can I access the value of the TextBox control.
Normally I would do this.Controls[childControlId] or a this.FindControl() but
neither of these actions retrieve the control. In fact no child controls
exist in the web control, I have implemented INamingContainer and my web
control is dereived from Control.
Any ideas on how I can get reference to my child controls after postback?
Craig