开发者

AjaxControlToolkit AnimationExtender - show animation on FormView Insert/Update

开发者 https://www.devze.com 2023-04-08 19:00 出处:网络
In my application开发者_开发百科, I have a FormView which allows Insert\'s and Update\'s. I want to show a message which dissappears after about 2-3 seconds whenever they insert or update. I figured t

In my application开发者_开发百科, I have a FormView which allows Insert's and Update's. I want to show a message which dissappears after about 2-3 seconds whenever they insert or update. I figured the AnimationExtender from the AjaxControlToolkit would be the best way of doing this, but I can't figure out how to get that animation to fire when a FormView is updated/inserted. Any ideas?


Have you tried calling the animation in the ItemInserted or ItemUpdated events for the FormView? That sounds like it would do the trick for you. They fire every time an Update or Insert occurs from that control.

Alternately, you could just set the TargetControlID of your AnimationExntender to the id of your Update / Insert button (the one's on your FormView with CommandName set to "Insert" or "Update"), then just specify your desired animation in the OnClick event:

<ajaxToolkit:AnimationExtender ID="myAnimExtender"
  runat="server" TargetControlID="updateBtn">
    <Animations>
        <OnClick> ... </OnClick>
    </Animations>
</ajaxToolkit:AnimationExtender>

Note that this technique requires you to have two AnimationExtenders, one for the Delete button and one for the Update button.

0

精彩评论

暂无评论...
验证码 换一张
取 消