default.aspx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 Button1_Click(object sender, EventArgs e)
  6. {
  7. // Introducing delay for demonstration.
  8. System.Threading.Thread.Sleep(3000);
  9. Label1.Text = "Page refreshed at " +
  10. DateTime.Now.ToString();
  11. }
  12. </script>
  13. <html xmlns="http://www.w3.org/1999/xhtml" >
  14. <head id="Head1" runat="server">
  15. <title>UpdateProgress Tutorial</title>
  16. <style type="text/css">
  17. #UpdatePanel1 {
  18. width:300px; height:100px;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <form id="form1" runat="server">
  24. <div>
  25. <asp:ScriptManager ID="ScriptManager1" runat="server">
  26. </asp:ScriptManager>
  27. <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  28. <ContentTemplate>
  29. <fieldset>
  30. <legend>UpdatePanel</legend>
  31. <asp:Label ID="Label1" runat="server" Text="Initial page rendered."></asp:Label><br />
  32. <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
  33. </fieldset>
  34. </ContentTemplate>
  35. </asp:UpdatePanel>
  36. <asp:UpdateProgress ID="UpdateProgress1" runat="server">
  37. <ProgressTemplate>
  38. Processing...
  39. </ProgressTemplate>
  40. </asp:UpdateProgress>
  41. </div>
  42. </form>
  43. </body>
  44. </html>