default.aspx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 id="Head1" runat="server">
  12. <title>UpdateProgress Example</title>
  13. <style type="text/css">
  14. #UpdatePanel1 {
  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 {
  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. </ContentTemplate>
  35. </asp:UpdatePanel>
  36. <asp:UpdateProgress ID="UpdateProgress1" runat="server">
  37. <ProgressTemplate>
  38. An update is in progress...
  39. </ProgressTemplate>
  40. </asp:UpdateProgress>
  41. </div>
  42. </form>
  43. </body>
  44. </html>