Loading web controls dynamically

EpcH

Newcomer
Joined
Jul 17, 2003
Messages
2
Location
USA
Hi all,

Is it possible in asp.net to load standard controls like checkboxes, buttons, etc dynamically?

For example, let say I have a table in a database with 10 rows, can I load and show just 10 checkboxes on a page?

I am completely newbie in asp.net, so if adding standard web controls dynamically is possible, I would appreciate links to any good tutorials about the subject.

Thanks all for reading this boring newbie question :)
 
Yes:

Dim c As Control = LoadControl("MyUserControl.ascx")

Or

Dim btnTest As New LinkButton
btnTest.ID = "DynamicallyAddedButton"
btnTest.Text = "Test"
'etc.

MyPlaceHolder.Controls.Add(btnTest)

Or do this with any naming container type of control.

Google ".NET Controls.Add" and I'm sure you'll have thousands of hits...
 
Back
Top