Insert Select Option in Asp.Net DropdownList control |
|
Answered By
Moderator1
on
1/19/2010 7:41:40 PM |
|
|
|
|
Hi,
If you add Select option before you bind the dropdown, it will not appear in the run-time. So you need to do the other way like below,
1. Bind your dropdown list with data from database
2. Insert the Select option into the option list.
Below is the sample code,
DropDownList.DataSource = yourDataTable;
DropDownList.DataBind();
DropDownList.Items.Insert(0, new ListItem("Select", "Select")); |
|
|
|
|
|