Controls You Can Use on Web Forms ASP.NET Standard Controls DropDownList Control
Essentially, to create a working DropDownList control, you need to add the control to the page and specify the list of items in the control.
The below procedures show the minimum steps needed to display a DropDownList control.
- Declare an <
asp:DropDownList > element on the page. For syntax, see DropDownList Control Syntax.
- Optionally set the list’s base properties.
<asp:dropdownlist id="myList" width=100 runat="server">
- Adding items to the list control is a separate process that depends on whether you will display a static list or a list generated dynamically at run time, or a list generated from a data source. For this example, we use statically defined list items.
Adding Items in a List Control Populating a List Control from a Database
|