Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 3.46 KB

disabling-actions-during-animation-vb.md

File metadata and controls

56 lines (35 loc) · 3.46 KB
uid title author description ms.author ms.date ms.assetid msc.legacyurl msc.type
web-forms/overview/ajax-control-toolkit/animation/disabling-actions-during-animation-vb
Disabling Actions during Animation (VB) | Microsoft Docs
wenz
The Animation control in the ASP.NET AJAX Control Toolkit is not just a control but a whole framework to add animations to a control. It also supports action... (VB)
riande
06/02/2008
a86c0276-6481-46ee-8b4f-8c2009399ee9
/web-forms/overview/ajax-control-toolkit/animation/disabling-actions-during-animation-vb
authoredcontent

Disabling Actions during Animation (VB)

by Christian Wenz

Download PDF

The Animation control in the ASP.NET AJAX Control Toolkit is not just a control but a whole framework to add animations to a control. It also supports actions, like mouse clicks. However when a mouse click starts an animation, it is desirable to disable mouse clicks during the animation.

Overview

The Animation control in the ASP.NET AJAX Control Toolkit is not just a control but a whole framework to add animations to a control. It also supports actions, like mouse clicks. However when a mouse click starts an animation, it is desirable to disable mouse clicks during the animation.

Steps

First of all, include the ScriptManager in the page; then, the ASP.NET AJAX library is loaded, making it possible to use the Control Toolkit:

[!code-aspxMain]

The animation will be applied to an HTML button like this:

[!code-aspxMain]

Note that an HTML Control is used instead of a Web Control since we do not want the button to create a postback; it shall just launch the client-side animation for us.

Then, add the AnimationExtender to the page, providing an ID, the TargetControlID attribute and the obligatory runat="server":

[!code-aspxMain]

Within the <Animations> node, <OnClick> is the right element to handle the mouse click. However, the button could be clicked during the animation, as well. The <EnableAction> element can take care of that. Setting Enabled="false" disables the button as part of the animation. Since we are using several individual animations (disabling the button and the actual animations), the <Parallel> element is required to glue the single animations together into one. Here is the complete markup for AnimationExtender:

[!code-aspxMain]

It would also be possible to re-enable to button after the animation, using the following XML element at the end of the list:

[!code-xmlMain]

However in the given scenario this would be useless since the button fades out and is not visible at the end of the animation.

The button is disabled as soon as the animation runs

The button is disabled as soon as the animation runs (Click to view full-size image)

[!div class="step-by-step"] Previous Next