3
Reply

Copy from one drpdown to another one by one

saifullah khan

saifullah khan

Aug 5 2011 12:58 PM
2.2k
i have two dropdowns dr1,dr2 and a button. dr1 contains items. i want that when i select an item from dr1 and click on button so that selected item must be coppied into dr2. when i select item2 from dr1 and press the button again it copies that item into dr2. i have used a code but i doesnt work and gives and error. can somebody tell me what i need to do.
 
protected void Button1_Click(object sender, EventArgs e) { DropDownList2.Items.Add(DropDownList1.SelectedItem);   }

Answers (3)