views:

596

answers:

2

I'm trying to apply the same animation to multiple TargetControlID's -- for example, in a modal dialog, I would like to have a cancel button and a little "x" graphic in the upper right, either of which closes the dialog.

Seems pretty inelegant to write two identical animations, one for each of these targets. I'd like to have one <AnimationExtender> and apply it to two controls.

Know what I mean? Any ideas?

Thanks,

  • Matt
A: 

Sounds like you want to use UpdateProgress control. It can be connected to an UpdatePanel for whatever buttons you have there.

(Or maybe I misunderstand you)

Faruz
A: 

The animation extender adds (VIA JavaScript) a click handler to the target control to start the animation. One simple way to do what you're trying to do would be by simulating a click on the target control whenever your second control is clicked. The AjaxControlToolkit includes a function that can help you do this.

Add this javascript to your page. Set 'onclick' of your second control to call this function:

function secondControlClick() {
    $common.tryFireEvent(yourtargetcontrol, 'click');
}

Let me know how this works out for you.

Gabriel

Gabriel McAdams