0

I have this:

<cc1:UpdatePanelAnimationExtender ID="UpdatePanelAnimationExtender1"
            TargetControlID="pnlUpdatePeriodDetails" runat="server">
            <Animations>
                <OnUpdating>
                   <Parallel duration="0">
                        <ScriptAction Script="onUpdating('divLoadingImage', 'divDetailsContent');" />
                        <EnableAction AnimationTarget="btnInvoke" Enabled="false" />                    
                    </Parallel>
                </OnUpdating>
                <OnUpdated>
                    <Parallel duration="0">
                        <ScriptAction Script="onUpdated('divLoadingImage', 'divDetailsContent');" /> 
                        <EnableAction AnimationTarget="btnInvoke" Enabled="true" />
                    </Parallel>
                </OnUpdated>
            </Animations>
     </cc1:UpdatePanelAnimationExtender> 

I want to create this animation extender programatically... but I am having trouble. Is it possible? Is it easy?

2 Answers 2

2

The extender's Animations property is a string that is parsed as XML, so you should be able to do this:

Controls.Add(
    new UpdatePanelAnimationExtender()
    {
        Animations = "<OnUpdating>...</OnUpdating><OnUpdated>...</OnUpdated>"
    }
);
Sign up to request clarification or add additional context in comments.

Comments

2

See http://msdn.microsoft.com/en-us/library/c0az2h86.aspx for details, but essentially you just have to call LoadControl with the path to your .ascx

1 Comment

That's very interesting! Unfortunately I am trying to do it all programatically, ie. UpdatePanelAnimationExtender ae = new UpdatePanelAnimationExtender().....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.