You May Add Controls to a Web Page Dynamically As Needed At Run Time Rather Than At Design Time. This Short Article Shows You How.
By: John Kilgo Date: April 5, 2003 Download The Code.
Printer Friendly Version
Sometimes when building a web form you do not know exactly how many controls of a certain type you will need on the form at run time. This problem can be easily solved by dynamically adding the forms at run time rather than adding them at design time. In this example we will use a simple interface to allow the user to state how many DropDownLists he or she wants on the web form. In real life you will probably determine based upon input from some other control (s) on the page. Either way The Solution To The Problem Is The Same.
As usual, lets get straight to the code. The .aspx file contains our