how to add user controls



Asume I have panel on a webform and I created few user controls (.ascx)
How do I programaticaly add my user controls to that panel so it displays them
as some sort of controls list? I've tried instantiating class and adding by
panel.Controls.Add(mycontrol) but it doesnt work and nothing comes up.
Thanks for help.

Uf
.



Relevant Pages

  • Re: two Windows message loops in .NET 2.0?
    ... If you made each of the panels user controls instead of something ... The right "panel" contains a mask that starts a series of modal dialoges. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: user control host form gets disabled
    ... > My main form contains a panel which I use to host user controls. ... > public class MyControl: UserControl ... > private void Remove_Click ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Expanding user controls
    ... I have a treeview and a panel inside of a form. ... different user controls get loaded into the panel. ... If the form is resized, or maximized the panel stretches with the form, but ...
    (microsoft.public.dotnet.languages.vb)
  • Re: "Global" objects
    ... The Main form is declaring an object (doesn't really matter what it ... these user controls are NOT placed onto the panel on the Main ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: "Global" objects
    ... does for purposes of this discussion) and a public method to return it. ... these user controls are NOT placed onto the panel on the Main ...
    (microsoft.public.dotnet.framework.windowsforms)