Hi,
I have created a page with a datalist that has a button and a image inside the itemtemplate. So what I trying to do is to connect the animationextender with the button (targetid) at runtime, wich does not work at all. Is it possible to connect (set target id) at runtime or must it be done in designtime?
//CC
Hi TCNC,
The Animation Framework has a n undocumented feature wherein any attribute assigned to the AnimationExtender is evaluated at runtime .
You can use it by suffixing the Attribute with the Attribute "Script"
EX: < ajaxToolkit:AnimationExtender Blah>
<OnClick>
<Resize Height="200" width="200" AnimationTargetScript="getTargetElement();" />
</OnClick>
</ajaxToolkit:AnimationExtender>
<script language="Javascript">
function getTargetElement(){
return someelementID;
}
</script>
This will cause the function getTargetElement to be called whenever the Animation is played.
You can probably set the ID of the Element to be animated in a hidden field.
In the Function "getTargetElement" read the HiddenField and return its value.
When the Animation plays , the target is automatically changed.
Hope this helps.
And if it resolves the issue , Please mark my reply as the answer
No comments:
Post a Comment