I am trying to add controls to the Dialog control dynamically. I add the controls to the ContentPane.TemplateControl.Controls collection. Whenever I do this, the control ends up on the page hosting the dialog and not in the dialog.
Is there something I need to do to get it to show up in the dialog correctly?
-Daniel
The sure fire way to add a control at runtime is to first add a placeholder control at Design-time. If you add the PlaceHolder control in the Dialog box at design-time, you can simply add your control to the PlaceHolder control's .Controls collection.
If your child control is still not showing up in the right place, my guess is that you have a CSS issue - ie. your child control is absolutely positioned, which is making it appear outside of the bounds of its container.
-Tony
Thanks for the response.
The problem is I want to inherit from the Dialog control and add my standard controls to the inherited class. Is this something that can be done with the dialog control? If not then I will just end up creating my own .ascx control which contains the dialog, but I was hoping to inherit from it instead.