What I'm trying to do is activate an animation only if the page is valid. It seems that the animation extender only allows client side conditions. What I'm trying to do is once a submit a form inside of an update panel. If the form is valid, then run an animation. In my server side code, I test to see if the page is valid. If it is not, I have set the ae.Enabled property to false. This doesn't seem to work. In fact, if my asp validators are set with the attribute of EnableClientScript="false" then my animation doesn't work at all.. The animation starts but then the post back occurs and stops the animation. I need it to post back and then start the animation, if the page is valid. Is there anyway to do this without setting the Animation property inside of the page_load?
Here is a sample of what I'm trying to do:
<cc1:AnimationExtender id="ae" runat="server" TargetControlID="btnSubmitForm">
<Animations>
<OnClick>
<Sequence AnimationTarget="pnlForm">
<EnableAction Enabled="false" />
<StyleAction AnimationTarget="pnlForm" Attribute="display" Value="block"/>
<Parallel AnimationTarget="pnlForm" Duration=".5" Fps="30">
<Move Horizontal="1500" Vertical="1550" />
I have tried this in the Page_Load but the panel just disappears immediately
Page.Validate();
if (this.Page.IsValid)
{
ae.Animations =
"<OnLoad>" +
" <Sequence>" +
" <EnableAction Enabled=\"false\" />" +
" <StyleAction AnimationTarget=\"pnlForm\" Attribute=\"display\" Value=\"block\"/>" +
" <Parallel AnimationTarget=\"pnlForm\" Duration=\".9\" Fps=\"30\">" +
" <Resize Height=\"0\" Width=\"0\" Unit=\"px\" />" +
" <FadeOut />" +
" </Parallel>" +
" </Sequence>" +
"</OnLoad>";
}
<FadeOut />
</Parallel>
</Sequence>
</OnClick>
</Animations>
</cc1:AnimationExtender>