<%@ Page language="c#" AutoEventWireup="false" %>
<HTML>
	<HEAD>
		<TITLE>第5章_高级Web控件 在网页中使用Calendar控件显示和选择日期</TITLE>
		<SCRIPT language="C#" runat="server">
			void MyCalendar_SelectionChanged(Object sender, System.EventArgs e)
			{
				// 获取 Calendar 控件中选择的日期
				MessageLabel.Text = "选择的日期是：" + MyCalendar.SelectedDate.ToShortDateString() + "<br>";
			}
		</SCRIPT>
	</HEAD>
	<body>
		<form id="Form1" runat="server">
			<h3>在网页中使用Calendar控件显示和选择日期</h3>
			<FONT face="宋体">请选择日期：</FONT>
			<BR>
			<asp:Calendar id="MyCalendar" runat="server" OnSelectionChanged="MyCalendar_SelectionChanged">
				<SelectedDayStyle BackColor="Yellow" ForeColor="Red"></SelectedDayStyle>
			</asp:Calendar>
			<BR>
			<asp:Label id="MessageLabel" runat="server">显示选择的日期</asp:Label>
		</form>
	</body>
</HTML>
