Click here to Skip to main content
Click here to Skip to main content

DropDownList

, 11 Oct 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
The DropDownList Web server control enables users to select from a single-selection drop-down list box. The DropDownList control is similar to the

Editorial Note

This articles was originally at wiki.asp.net but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.

The DropDownList Web server control enables users to select from a single-selection drop-down list box. The DropDownList control is similar to the ListBox Web server control. It differs in that it shows only the selected item in a box.

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 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 Its  SelectedIndex property to programmatically determine the selected item index , and use its SelectedValue to get the value of the SelectedItem.

 

DropDownList How To :

How to: Add DropDownList Web Server Controls to a Web Forms Page

How to: Add Items in List Web Server Controls

How to: Determine the Selection in List Web Server Controls

How to: Populate List Web Server Controls from a Data Source

How to: Respond to Changes in List Web Server Controls

How to: Set the Selection in List Web Server Controls

 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

ASP.NET Community

United States United States
The ASP.NET Wiki was started by Scott Hanselman in February of 2008. The idea is that folks spend a lot of time trolling the blogs, googlinglive-searching for answers to common "How To" questions. There's piles of fantastic community-created and MSFT-created content out there, but if it's not found by a search engine and the right combination of keywords, it's often lost.
 
The ASP.NET Wiki articles moved to CodeProject in October 2013 and will live on, loved, protected and updated by the community.
Group type: Collaborative Group

247 members


Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web03 | 2.8.141015.1 | Last Updated 11 Oct 2013
Article Copyright 2013 by ASP.NET Community
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid