EpcH Posted January 18, 2006 Posted January 18, 2006 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 :) Quote
bri189a Posted January 18, 2006 Posted January 18, 2006 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... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.