Page view counter
HomeLearnVideosHow Do I: Add Controls to an ASP.NET Web Page Programmatically  

How Do I: Add Controls to an ASP.NET Web Page Programmatically

In this video Chris Pels will show how to create an ASP.NET server control programmatically at runtime and add it to a page. First, learn the basic concept of adding a control to a page programmatically. Then, the concept of a "container" control is examined which is necessary for adding a new control programmatically at runtime. Next, learn considerations for nesting programmatically added controls, and how creating separate methods can compartmentalize the process to make it more maintainable. In addition, learn considerations for managing view state when adding controls dynamically.

Presented by Chris Pels

Duration: 33 minutes, 56 seconds

Date: 24 July 2008

Watch the video   |   Download the video   |   Get VB code  or  C# code

Video downloads: WMV | Zune | iPod | PSP | MPEG-4 | 3GP

Audio downloads: AAC | WMA | MPEG-4 | MPEG-3 | MPEG-2

Comments : 3

Leave a Comment

mcgmatt : On July 29, 2008 12:02 AM said:

The part about Page_Init is very important, and should have been covered first, followed by the rest of the video with all your work being done inside Page_Init.  If anyone stops watching this video before the 30-minute mark, they'll think they should add controls in Page_Load, then they'll be confused when their controls disappear on postback.

atarikg : On October 04, 2008 2:05 AM said:

thanks, this is one of the videos I wanna watch...

hlaiasp : On November 13, 2008 10:07 PM said:

I am using VC2005 and ASP.NET 2.0. I noticed you are using 3.5.

I don't get intellisense for "mainContent" and "newsItems". Is it possible to make it work in 2.0?

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Microsoft Communities