Click here to Skip to main content
15,668,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to fade-in and fade-out a panel on click of a button. In the following code a click on the
panel helps the panel to fade away. How to use the button for both to happen.

<asp:UpdatePanel ID="UpdatePanel133" runat="server" >
    <asp:Panel ID="ss" runat="server"  style=" width:544px; height:333px; background-color:Red; margin-left:230px; top:312px">
<asp:Button ID="Animate" runat="server" OnClick="ClickToAnimate" Text="ClickToAnimate" BackColor="Green" style="
     margin-left:12px; height:24px" />
<asp:AnimationExtender id="MyExtender"
  runat="server" TargetControlID="ss">
      <FadeOut Duration=".5" Fps="20" /><%-- FadeIn =".1" Fps="10"/>--%>

protected void ClickToAnimate(object sender, EventArgs e)


1 solution

Have you thought about changing your animation extenders to jQuery ?
If so, the JavaScript would be as easy as this :
$('#<%=UpdatePanel133.ClientID %>').fadeIn();
$('#<%=UpdatePanel133.ClientID %>').fadeOut();
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900