Posted on: 6/7/2013 9:29:38 PM | Views : 382

I have 30 dropdownlists which are in a table control(3 row2 10 cols). Each dropdownlist has the same datasource from SQL Server,
in each dropdownlist databound event I ahve function call callListBox(sender); and this function is below:
private void ListBox(object sender) { //create ListBox object ListBox lb = sender as ListBox;
if (!IsPostBack) { if (lb.Items.Count > 0) { //insert "All" on the top of the listbox lb.Items.Insert(0, "Select"); lb.Items[0].Value = "Select"; } } }
So that first item is always show "Select" to indicate to pick up an item.
in the datasource table it has two fields (Name, ID). From the dropdownlist, it shows Name, After I select one item from the dropdownlist,
I want to get the ID related to that name. How can I do this? 
I have a test using a Label like this:
int i = DropDownList ...

Go to the complete details ...