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); }
Copy from one drpdown to another one by one
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Praveen KumarRank #4 · 79.9K reputationPosted Aug 5, 2011, 10:15 PM EDT
Satyapriya NayakRank #47 · 31.5K reputationPosted Aug 7, 2011, 2:24 AM EDT
protected void Button1_Click(object sender, EventArgs e)
{
DropDownList2.Items.Add(DropDownList1.SelectedValue);
}
You can try this code also.
Neeraj PandeyRank #4,815 · 324 reputationPosted Aug 12, 2011, 3:38 AM EDT