Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
Hi,

I have two update panels. The first update panel has drop down list and the other has repeater control.
On SelectionIndexChanged event of dropdownlist I am binding repeater, but the updation isinconsistent.


Using upAgencyRatings.Update(); method in ddlCompany_SelectionIndexChanged event.

C#
<asp:UpdatePanel runat="server" ID="upCompany" UpdateMode="Conditional">
 <ContentTemplate>
 <asp:DropDownList ID="ddlCompany" runat="server" CssClass="dropdown" Width="260px"
   ToolTip="Company" AutoPostBack="true"   OnSelectedIndexChanged="ddlCompany_SelectedIndexChanged">
</asp:DropDownList>
<ajaxControls:ListSearchExtender ID="lseCompanySearcher" QueryPattern="contains"
 runat="server" TargetControlID="ddlCompany" PromptCssClass="listSearchPrompt">
</ajaxControls:ListSearchExtender>
<asp:RequiredFieldValidator ID="rfvCompanyID" runat="server" ControlToValidate="ddlCompany"
ErrorMessage="Company is required." Display="None" SetFocusOnError="true"></asp:RequiredFieldValidator>
</ContentTemplate>
</asp:UpdatePanel>

<asp:UpdatePanel ID="upAgencyRatings" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Repeater ID="rptrAgency" runat="server" OnItemCommand="rptrAgency_ItemCommand"
OnItemDataBound="rptrAgency_ItemDataBound">
</asp:Repeater>
Posted
Comments
JoCodes 18-Dec-13 5:48am    
Can you post the selectidexchanged code here?

from your code the possible solutions are-

1. use validation group for controls.
2. assure to use .update after completing the binding of repeater.
3. Assure that Are these two update panels are inside another Update panel.
4. Try to use AsyncPostbackTrigger for update panel upAgencyRatings.
 
Share this answer
 
Well, thanks for your replies guys. Solved it using below steps -

1. Removed update panel of Drop Down List.
2. Added AsyncPostbackTrigger for update panel upAgencyRatings.
3. Removed code upAgencyRatings.Update(); from code behind.
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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