TriggersDeclarativeMarkupCS.aspx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. </script>
  6. <html xmlns="http://www.w3.org/1999/xhtml" >
  7. <head runat="server">
  8. <title>UpdatePanel Trigger Declarative Syntax</title>
  9. <style type="text/css">
  10. body {
  11. font-family: Lucida Sans Unicode;
  12. font-size: 10pt;
  13. }
  14. button {
  15. font-family: tahoma;
  16. font-size: 8pt;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <form id="form1" runat="server">
  22. <div>
  23. <asp:Button ID="Button1"
  24. Text="Refresh Panel"
  25. runat="server" />
  26. <asp:ScriptManager ID="ScriptManager1"
  27. runat="server" />
  28. <asp:UpdatePanel ID="UpdatePanel1"
  29. UpdateMode="Conditional"
  30. runat="server">
  31. <Triggers>
  32. <asp:AsyncPostBackTrigger ControlID="Button1" />
  33. </Triggers>
  34. <ContentTemplate>
  35. <fieldset>
  36. <legend>UpdatePanel content</legend>
  37. <%=DateTime.Now.ToString() %>
  38. </fieldset>
  39. </ContentTemplate>
  40. </asp:UpdatePanel>
  41. </div>
  42. </form>
  43. </body>
  44. </html>