Hi Ted,
I'm not 100% sure I understand your answer. Will the code below work if the TextBox is in a naming container (and therefore has that long munged ClientID) or not? If not, how do I make it work, because TextBoxes are almost always in naming containers in any reasonably complex application. I havent figured out how the heck to get the ClientID into the ConditionScript attribute of the Condition tag.
/Mattias
Ted Glaza [MSFT]:
Hi Marinus/Mattias,
I think the best thing to do, as Mattias suggests, is to use the ConditionAnimation. This will let you decide whether or not to play the animation by running a little bit of JavaScript. Assuming your TextBox has an ID="TextBox1" (and isn't in a naming container - but if it is, then its ClientID, which is the munged ID of your server control when written to the client, will look something like ctl00_MyPanel1_TextBox1), you could define your animation as:
.
.
.
<Animations>
<OnClick>
<%-- Compared TextBox1.value to 2 single quote signs, not a double quote, to see if it's empty --%>
<Condition ConditionScript="$('TextBox1').value == ''">
.
. <%-- Original animation markup here --%>
.
</Condition>
</OnClick>
</Animations>
.
.
.
If you really do want to invoke the animation from the server, then you could emit code server side to interact with the Toolkit (as discussed in this post) that will play the animation (as discussed here - and each animation, like OnClick, OnMouseOver, etc., has it's own function you can call to invoke it). If this doesn't answer your question, please keep posting.
Thanks,
Ted