saifullah khan

saifullah khan

  • NA
  • 335
  • 301k

Copy from one drpdown to another one by one

Aug 5 2011 12:58 PM
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)