default.aspx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. Label1.Text = "Panel refreshed at " +
  8. DateTime.Now.ToString();
  9. }
  10. </script>
  11. <html xmlns="http://www.w3.org/1999/xhtml" >
  12. <head runat="server">
  13. <title>UpdatePanel Tutorial</title>
  14. <style type="text/css">
  15. #UpdatePanel1, #UpdatePanel2 {
  16. width:300px; height:100px;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <form id="form1" runat="server">
  22. <div>
  23. <asp:ScriptManager id="ScriptManager1" runat="server">
  24. </asp:ScriptManager>
  25. <asp:UpdatePanel id="UpdatePanel1" runat="server">
  26. <ContentTemplate>
  27. <fieldset>
  28. <legend>UpdatePanel1</legend>
  29. <asp:Label ID="Label1" runat="server" Text="Panel Created"></asp:Label><br />
  30. <asp:Button ID="Button1" runat="server" Text="Refresh Panel 1" OnClick="Button1_Click" />
  31. </fieldset>
  32. </ContentTemplate>
  33. </asp:UpdatePanel>
  34. <asp:UpdatePanel ID="UpdatePanel2" runat="server">
  35. <ContentTemplate>
  36. <fieldset>
  37. <legend>UpdatePanel2</legend>
  38. <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
  39. </fieldset>
  40. </ContentTemplate>
  41. </asp:UpdatePanel>
  42. </div>
  43. </form>
  44. </body>
  45. </html>