default.aspx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <%@ Page Language="C#" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <script runat="server">
  5. protected void Button_Click(object sender, EventArgs e)
  6. {
  7. System.Threading.Thread.Sleep(3000);
  8. }
  9. </script>
  10. <html xmlns="http://www.w3.org/1999/xhtml" >
  11. <head runat="server">
  12. <title>UpdateProgress Example</title>
  13. <style type="text/css">
  14. #UpdatePanel1, #UpdatePanel2, #UpdateProgress1 {
  15. border-right: gray 1px solid; border-top: gray 1px solid;
  16. border-left: gray 1px solid; border-bottom: gray 1px solid;
  17. }
  18. #UpdatePanel1, #UpdatePanel2 {
  19. width:200px; height:200px; position: relative;
  20. float: left; margin-left: 10px; margin-top: 10px;
  21. }
  22. #UpdateProgress1 {
  23. width: 400px; background-color: #FFC080;
  24. bottom: 0%; left: 0px; position: absolute;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <form id="form1" runat="server">
  30. <div>
  31. <asp:ScriptManager ID="ScriptManager1" runat="server" />
  32. <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
  33. <ContentTemplate>
  34. <%=DateTime.Now.ToString() %> <br />
  35. <asp:Button ID="Button1" runat="server" Text="Refresh Panel" OnClick="Button_Click" />
  36. </ContentTemplate>
  37. </asp:UpdatePanel>
  38. <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
  39. <ContentTemplate>
  40. <%=DateTime.Now.ToString() %> <br />
  41. <asp:Button ID="Button2" runat="server" Text="Refresh Panel" OnClick="Button_Click"/>
  42. </ContentTemplate>
  43. </asp:UpdatePanel>
  44. <asp:UpdateProgress ID="UpdateProgress1" runat="server">
  45. <ProgressTemplate>
  46. Update in progress...
  47. </ProgressTemplate>
  48. </asp:UpdateProgress>
  49. </div>
  50. </form>
  51. </body>
  52. </html>