I have a checkbox to indicate that communication address is same as the permanent address. There are 4 dropdownlists –
- DRP_Comm_Country1
- DRP_Comm_State1
- DRP_Per_Country2
- DRP_Per_State2
When i check the checkbox, the items of permanent address dropdownlists should be same as that of communication address dropdownlists.How to make it possible?
My code is
protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
DRP_Per_Country2.SelectedIndex = DRP_Comm_Country1.SelectedIndex;
}
But the SelectedIndexChanged() Event of DRP_Per_Country2 is not get fired.Is it a wrong method? If so ,how to work it?
First of all, you have to set the
property for all the
DropDownList. If this wont work then call theSelectedIndexChangedEvent manuallyThis will surely fire the event.