Assembly: System.Web (in system.web.dll)
[ValidationPropertyAttribute(L"SelectedItem")] public ref class DropDownList : public ListControl, IPostBackDataHandler
/** @attribute ValidationPropertyAttribute("SelectedItem") */ public class DropDownList extends ListControl implements IPostBackDataHandler
Use the DropDownList control to create a single-selection drop-down list control. You can control the appearance of the DropDownList control by setting the BorderColor, BorderStyle, and BorderWidth properties.
To specify the items that you want to appear in the DropDownList control, place a ListItem object for each entry between the opening and closing tags of the DropDownList control.
The DropDownList control also supports data binding. To bind the control to a data source, create a data source, such as a System.Collections.ArrayList object, that contains the items to display in the control. Then, use the Control.DataBind method to bind the data source to the DropDownList control.
Use the SelectedIndex property to programmatically determine the index of the item selected by the user from the DropDownList control.
The markup rendered by default for this control might not conform to accessibility standards such as the Web Content Accessibility Guidelines 1.0 (WCAG) priority 1 guidelines. For details about accessibility support for this control, see ASP.NET Controls and Accessibility.
The following code example demonstrates how to create a DropDownList control that contains four items.
The following code example demonstrates how to create a DropDownList control though data binding.
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.