Multiple UpdatePanelAnimationExtender Controls AjaxControlToolKit

核能气质少年 提交于 2019-12-12 08:58:38

问题


I am having a problem with the UpdatePanelAnimationExtender and multiple update panels. What I want to happen is for the panel to fade out, update, and then fade back in.

However, it fades out all the panels and only fades the one I updated back in. Apparently this is a rather common problem with UpdatePanelAnimationExtender, but I can't seem to find a solution. Would anyone happen to know of a way to work around this problem? Thanks in advance.

Here is some sample code:

<asp:UpdatePanel ID="update1" runat="server" UpdateMode="Conditional">
  //--My Code goes in here
</asp:UpdatePanel>

<cc1:UpdatePanelAnimationExtender ID="updateAnimation1" runat="server" TargetControlID="update1">
     <Animations>
         <OnUpdating>
              <FadeOut Duration="0.2" Fps="20" />
         </OnUpdating>
         <OnUpdated>
              <FadeIn Duration="0.2" Fps="20" />
         </OnUpdated>
     </Animations>
</cc1:UpdatePanelAnimationExtender>

<asp:UpdatePanel ID="update2" runat="server" UpdateMode="Conditional">
  //--My Code goes in here
</asp:UpdatePanel>

<cc1:UpdatePanelAnimationExtender ID="updateAnimation2" runat="server" TargetControlID="update2">
     <Animations>
         <OnUpdating>
              <FadeOut Duration="0.2" Fps="20" />
         </OnUpdating>
         <OnUpdated>
              <FadeIn Duration="0.2" Fps="20" />
         </OnUpdated>
     </Animations>
</cc1:UpdatePanelAnimationExtender>

回答1:


Set the UpdateMode=Always on the UpdatePanels and that will fix it




回答2:


I use the method UpdatePanelAnimationExtender conditional and valid with javascript. Greetings.

<cc1:UpdatePanelAnimationExtender ID="upaStock" runat="server" TargetControlID="upStock">
<Animations> 
    <OnUpdating>
        <Sequence>
            <Parallel duration="0">
                <Condition ConditionScript="document.getElementById('ctl00_p1_hdfValidacion2').value == 'true';">
                    <ScriptAction Script="onUpdating('ctl00_p1_pnlPopup','dviStock','divCuerpo');" />
                </Condition>
            </Parallel>
        </Sequence>
    </OnUpdating>

    <OnUpdated>
        <Sequence>
            <Parallel duration="0">
                <ScriptAction Script="onUpdated('ctl00_p1_pnlPopup'); document.getElementById('ctl00_p1_hdfValidacion2').value = 'false';" />
            </Parallel>
        </Sequence>
    </OnUpdated>
</Animations>



来源:https://stackoverflow.com/questions/725565/multiple-updatepanelanimationextender-controls-ajaxcontroltoolkit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!