更新面板未使用.Update()方法进行更新 [英] Update Panel is not updating using .Update() method

查看:120
本文介绍了更新面板未使用.Update()方法进行更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有两个更新面板。第一个更新面板有下拉列表,另一个有转发器控件。

在下拉列表的SelectionIndexChanged事件中,我是绑定转发器,但更新是不一致的。





使用upAgencyRatings.Update(); ddlCompany_SelectionIndexChanged事件中的方法。



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.

<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>

推荐答案

从您的代码可能的解决方案 -



1.使用验证组进行控制。

2.确保在完成转发器的绑定后使用.update。

3.确保这两个更新面板是否在另一个更新面板中。

4.尝试使用AsyncPostbackTrigger进行更新面板upAgencyRatings。
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.


好的,谢谢你们的回复。使用以下步骤解决了这个问题 -



1.删除了下拉列表的更新面板。

2.为更新面板upAgencyRatings添加了AsyncPostbackTrigger。

3.删除代码upAgencyRatings.Update();来自代码。
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.


这篇关于更新面板未使用.Update()方法进行更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆