Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a control dynamically
Message
De
21/04/2006 06:59:02
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
21/04/2006 01:24:53
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01115236
Message ID:
01115306
Vues:
8
This message has been marked as the solution to the initial question of the thread.
>Is there a way to add a control dynamically on a Web form? I would like to add a label control named Javascript everytime a Page_Load() event occurs. I have one right now but I have to paste it on all my Web forms. I thought there could be a way to do that in my generic Page_Load() code.

Yes there is. Controls.Add(...) or Controls.AddAt(...). ie:
 Label myLabel = new Label();
 myLabel.Text = "This is added at runtime:" + DateTime.Now.ToString();
 Controls.Add(myLabel);
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform