Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, i was trying to call a dropdownlist selected index change problematically without actually selecting it. I have an AJAX Accordion with 7 accordion panels. On the first accordion users are meant to enter their details, on the second accordion they have to fill out some details as well up to the 7th accordion. There is a dropdownlist control on the 3rd accordion that will populate the data entered in the 2nd accordion after the button click that is inside the second accordion panel. But after the click of the button the dropdownlist listitems does not chnage Here my code

ASP.NET
<asp:DropDownList ID="ddpPassportOwnerName" runat="server" ClientIDMode="Static" ValidationGroup="PassportDetails" AutoPostBack="true" >


C#
protected void btnSaveDependentDetails_Click(object sender, EventArgs e)
{
//do some manipulations [i remove some code for brevity]
ddpPassportOwnerName.SelectedIndexChanged += new EventHandler(DoSomething);

}


protected void DoSomething(object sender, EventArgs e)
    {
        this.ddpPassportOwnerName.Items.Add(new ListItem(hiddenfiled.value));
    }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900