Reputation: 52942
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?
Upvotes: 0
Views: 227
Reputation: 77530
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>"
}
);
Upvotes: 2
Reputation: 73253
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
Upvotes: 2