Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Web Control To Page In Page_Load
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01451004
Message ID:
01451011
Views:
28
Here's a link that helped me to understand how to add/remove dynamic controls in ASP.NET.

http://weblogs.asp.net/infinitiesloop/archive/2006/08/25/TRULY-Understanding-Dynamic-Controls-_2800_Part-1_2900_.aspx


>I'm completely new to ASP.Net so...
>
>I created a user control with some fields on it. I want to add it to a page in Page_Load. I'm assuming that this is the place to do it.
>So I dropped a panel on the page, then in Page_Load I have:
>
>
>Params_AssCumLtDetail Params = new Params_AssCumLtDetail();
>pnlParams.Controls.Add(Params);
>
>
>When I run it, I don't see anything.
>
>When I do this:
>
>
>Label myLabel = new Label ( );
>myLabel.Text = "Sample Label"
>pnlParams.Controls.Add ( myLabel );
>
>
>The label appears.
>
>So what's wrong here?
State of Florida, DCF
Previous
Reply
Map
View

Click here to load this message in the networking platform