> Hi,
> I'm building a custom control and I have an issue. My custom control has a
[quoted text clipped - 10 lines]
> a
> very good idea and sometimes it works sometimes not.)
Calling EnsureChildControls in the Text property is exactly what I'd try:
public string Text
{
get {EnsureChildControls(); return textBox.Text;}
set {EnsureChildControls(); textBox.Text = value;}
}
...
> protected override void CreateChildControls()
> {
[quoted text clipped - 5 lines]
> this.ChildControlsCreated = true;
> }
If you don't call EnsureChildControls earlier, it will be called in
PreRender, which is likely to be too late.
John
sam - 21 Jul 2006 22:29 GMT
And actually doing that is standard best practice.