default.aspx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 {
  15. width:200px; height:200px; position: relative;
  16. float: left; margin-left: 10px; margin-top: 10px;
  17. border-right: gray 1px solid; border-top: gray 1px solid;
  18. border-left: gray 1px solid; border-bottom: gray 1px solid;
  19. }
  20. #UpdateProgress1, #UpdateProgress2 {
  21. width: 200px; background-color: #FFC080;
  22. position: absolute; bottom: 0px; left: 0px;
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <form id="form1" runat="server">
  28. <div>
  29. <asp:ScriptManager ID="ScriptManager1" runat="server" />
  30. <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
  31. <ContentTemplate>
  32. <%=DateTime.Now.ToString() %> <br />
  33. <asp:Button ID="Button1" runat="server" Text="Refresh Panel" OnClick="Button_Click" />
  34. <asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server">
  35. <ProgressTemplate>
  36. UpdatePanel1 updating...
  37. </ProgressTemplate>
  38. </asp:UpdateProgress>
  39. </ContentTemplate>
  40. </asp:UpdatePanel>
  41. <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
  42. <ContentTemplate>
  43. <%=DateTime.Now.ToString() %> <br />
  44. <asp:Button ID="Button2" runat="server" Text="Refresh Panel" OnClick="Button_Click"/>
  45. <asp:UpdateProgress ID="UpdateProgress2" AssociatedUpdatePanelID="UpdatePanel2" runat="server">
  46. <ProgressTemplate>
  47. UpdatePanel2 updating...
  48. </ProgressTemplate>
  49. </asp:UpdateProgress>
  50. </ContentTemplate>
  51. </asp:UpdatePanel>
  52. </div>
  53. </form>
  54. </body>
  55. </html>