You don't have to use LoadControl.
Your dim statement is working fine. You've simply forgotten to add the
control to the page.
For this you should use Page.Controls.Add
Here's more info:
http://msdn.microsoft.com/library/de...mmatically.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at
http://www.able-consulting.com
"MC D" <> wrote in message
news:%...
> When I dynamically add a control by doing something like
>
> dim x as control = Page.LoadControl("myControl.ascx")
>
> am I actually loading the control from disk??? I don't really understand
why
> I can't access the class for the user control directly... in other words
> just say:
>
> dim x as new myControl()
>
> (which doesn't generate an error, but it wil not render the UI)
>
> If I'm adding a control dozens of times on a page, is this very
> in-efficient?
>
> Thanks for any help!
>
> -D
>
>