Dynamically Adding Controls to a Page

ASP.NET supports dynamic control creation, and as a result, dynamic Web applications. You can use Repeater, DataList, or the DataGrid controls, or render dynamic HTML for a considerable degree of dynamic customization.

When you need complete customization, you can dynamically add programmatically created controls to a page. The controls must be added to a container control. You can use the PlaceHolder or Panel controls as containers or access the HtmlForm control through the page's Controls collection. The rest of the effort is just VB code.

Programmatically Adding Static Text to a Page

If you want to add static text dynamically to a page, you can create an instance of the Label control and place it on a ...

Get Visual Basic® .NET Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.