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); }
Loading
Praveen KumarPosted Aug 6, 2011, 2:15 AM
Neeraj PandeyPosted Aug 12, 2011, 7:38 AM
Satyapriya NayakPosted Aug 7, 2011, 6:24 AM
protected void Button1_Click(object sender, EventArgs e)
{
DropDownList2.Items.Add(DropDownList1.SelectedValue);
}
You can try this code also.