Here's my scenario, upon the completion a button click event I am trying to play an animation on a panel to alert user to the status text just updated. This is in an updatepanel, so the user can't tell if pressing add to cart is working so I thought a nifty
animation to get their attention would do the trick.
The animationextender var is always returning null no matter how I go about, whether I use the behaviorid or controlid or even control.ClientID the control is not found. I suspect that lifecycle is playing a big role here but i'm not sure how to go about
it differently.
UPDATE: Tried condnesing code with the same outcome:
ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "tmp", "<script type='text/javascript'>$find('MessageFlasher').get_OnClickBehavior().get_animation().play();</script>", False)
Here is the jquery function that is failing,
function PlayAnimation() {
var animationExtender = $find('MessageFlasher'); //BehaviorID of Extender
if (animationExtender)
{
animationExtender.get_OnClickBehavior().get_animation().play();
}
};
The PlayAnimation function is being called at the end of a button click method like this
ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "tmp", "<script type='text/javascript'>PlayAnimation();</script>", False)
Here is the TargetControl and extender;
<asp:Panel ID="pnl_popup" ClientIDMode="Static" runat="server" > <asp:Label ID="lbl_Messagef" ViewStateMode="Disabled" Text="" runat="server" /> </asp:Panel>
<asp:AnimationExtender ID="AnimationExtender11" BehaviorID="MessageFlasher" runat="server" Enabled="True" TargetControlID="pnl_popup"><Animations><OnClick><Sequence><EnableAction Enabled="false" /><Color AnimationTarget="pnl_popup"
Duration="1"
StartValue="#FF0000"
EndValue="#666666"
Property="style"
PropertyKey="backgroundColor" /><Color AnimationTarget="pnl_popup"
Duration="1"
StartValue="#FF0000"
EndValue="#666666"
Property="style"
PropertyKey="backgroundColor" /><EnableAction Enabled="true" /> <fadeout duration=".8" FPS="30" /></Sequence></OnClick></Animations></asp:AnimationExtender>