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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.