Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
User Controls
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Titre:
Divers
Thread ID:
00759524
Message ID:
00759685
Vues:
19
>It doesn't show up on the page. If I just add a plain old TextBox instead of a UserControl, it works fine.
>
>Any ideas what I might be missing?

Here is some code from the IBuySpy sample application for dynamically loading UserControls onto a web page. This is a great sample app for learning how to dynamically load usercontrols.
LeftPane.Controls.Add(Page.LoadControl("~/DesktopModules/SignIn.ascx"));
You should be putting this into the Page_Init event handler, not the Page_Load event handler because of the way that the events fire.

You can debug your aspx pages by adding trace=true at the top and it will show you all the control hierarchy at runtime on your page. Using trace.write will output debug statements at the bottom of the page.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform