default.aspx 1.7 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 Calendar1_SelectionChanged(object sender, EventArgs e)
  6. {
  7. TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();
  8. Label1.Text = "";
  9. }
  10. protected void Button1_Click(object sender, EventArgs e)
  11. {
  12. Label1.Text = "Tickets are available as of " + DateTime.Now.ToString() + ".";
  13. }
  14. </script>
  15. <html xmlns="http://www.w3.org/1999/xhtml">
  16. <head id="Head1" runat="server">
  17. <title>UpdatePanel with Validators Example</title>
  18. </head>
  19. <body>
  20. <form id="form1" runat="server">
  21. <div>
  22. <asp:ScriptManager ID="ScriptManager1" runat="server" />
  23. <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  24. <ContentTemplate>
  25. Select a date below or enter a date:
  26. <asp:TextBox ID="TextBox1" runat="server" Width="70px"></asp:TextBox><br />
  27. <asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="Calendar1_SelectionChanged" />
  28. <br />
  29. Specify number of tickets (1-10):
  30. <asp:TextBox ID="TextBox2" runat="server" Width="40px"></asp:TextBox><br />
  31. <asp:Button ID="Button1" runat="server" OnClientClick="ClearLastMessage('Label1')" Text="Check Availability" OnClick="Button1_Click" />
  32. <br />
  33. <br />
  34. <asp:Label ID="Label1" runat="server"></asp:Label>
  35. <br />
  36. </ContentTemplate>
  37. </asp:UpdatePanel>
  38. </div>
  39. </form>
  40. </body>
  41. </html>