Animate function in asp.net 4.0 Use Jquery.
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head id="Head1" runat="server">
  5. <title></title>
  6. <style type="text/css">
  7. .contentarea
  8. {
  9. width:300px;
  10. height:250px;
  11. font-size:16px;
  12. border:5px solid red;
  13. background:#ccc666;
  14. color:#000000;
  15. }
  16. </style>
  17. <script src="js/jquery-1.4.1.min.js" type="text/javascript"></script>
  18. <script language="javascript" type="text/javascript">
  19. $(document).ready(function () {
  20. var regular = true;
  21. $("#<%=btnsubmit.ClientID %>").click(function (e) {
  22. e.preventDefault();
  23. if (regular == true) {
  24. $(".contentarea").animate({
  25. opacity: 0.5,
  26. width: "500px",
  27. height: "280px",
  28. fontSize: "42px",
  29. borderwidth: "15px"
  30. }, "slow");
  31. }
  32. else {
  33. $(".contentarea").animate({
  34. opacity: 0.5,
  35. width: "300px",
  36. height: "100px",
  37. fontSize: "16px",
  38. borderwidth: "55px"
  39. }, "slow");
  40. }
  41. regular = !regular;
  42. });
  43. });
  44. </script>
  45. </head>
  46. <body>
  47. <form id="form1" runat="server">
  48. <fieldset id="field1" runat="server" title="Animated panal">
  49. <asp:Button ID="btnsubmit" runat="server" Text="Animate" />
  50. <br />
  51. <br />
  52. <asp:Panel ID="Panel1" runat="server" CssClass="contentarea">
  53. I am Dipankar Biswas
  54. </asp:Panel>
  55. </fieldset>
  56. </form>
  57. </body>
  58. </html>

Button click