Reputation: 385
It seems like my update panel isn't updating my form after I click an item in my listview. When I pass by breakpoint in my load method it seems to input everything properly and yet...
.aspx
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlConfig" runat="server" AutoPostBack="True">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
.aspx.cs
protected void ListView1_SelectedIndexChanged(object sender, EventArgs e)
{
//get the object
//...
//Assign the value to the DropDownList
this.ddlConfig.Items.FindByText(Configurations.Find(d => d.ID == ConfigurationID).Name).Selected = true;
}
Upvotes: 1
Views: 48
Reputation: 449
I used something similar in my project and perhaps there's several objects getting selected in the dropdownlist at the same time ? If so, try something like this
//Assign the value found to the selectedValue of the ddlConfig
this.ddlConfig.SelectedValue = this.ddlConfig.Items.FindByText(Configurations.Find(d => d.ID == ConfigurationID).Name).Value;
Upvotes: 1