<html>
  <head>
	<script language="C#" runat="server">
		void CheckBox1_CheckedChanged(object sender, System.EventArgs e)
		{
			Calendar1.ShowNextPrevMonth=!Calendar1.ShowNextPrevMonth;
		}
		//控制前、后月提示链接的显示与否
		void CheckBox2_CheckedChanged(object sender, System.EventArgs e)
		{
			Calendar1.ShowDayHeader=!Calendar1.ShowDayHeader;
		}
		//控制星期的显示与否
		void CheckBox3_CheckedChanged(object sender, System.EventArgs e)
		{
			Calendar1.ShowGridLines=!Calendar1.ShowGridLines;
		}
		//控制表格线的显示与否
		void CheckBox4_CheckedChanged(object sender, System.EventArgs e)
		{
			Calendar1.ShowTitle=!Calendar1.ShowTitle;
		}
		//控制表头的显示与否
		void Date_Selected(object sender, System.EventArgs e)
		{
			Label1.Text="您选择的日期是："+Calendar1.SelectedDate.ToShortDateString();
		//当日历中日期的选择改变时触发改事件，提示选择的日期为哪一天
		}

	</script>
   </head>
	<body>
		<h3><font face="Verdana">Calendar控件及CheckBox控件的基本用法</font></h3>
		<form runat="server" method="post">
			<table width=800><tr><td Width=400>
			<asp:Calendar id="Calendar1" runat="server" OnSelectionChanged="Date_Selected">
			</asp:Calendar></td><td><table width=100%><tr>
			<asp:CheckBox id="CheckBox1" runat="server" Text="不显示前、后月链接" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" /></tr><tr>
			<asp:CheckBox id="CheckBox2" runat="server" Text="不显示星期" AutoPostBack="True" OnCheckedChanged="CheckBox2_CheckedChanged" ></asp:CheckBox></tr><tr>
			<asp:CheckBox id="CheckBox3" runat="server" Text="显示表格线" AutoPostBack="True" OnCheckedChanged="CheckBox3_CheckedChanged" ></asp:CheckBox></tr><tr>
			<asp:CheckBox id="CheckBox4" runat="server" Text="是否显示表头" AutoPostBack="True" OnCheckedChanged="CheckBox4_CheckedChanged" ></asp:CheckBox></tr></table>
			</td></tr></table>
			<br>
			<asp:Label id="Label1" runat="server" />
		</form>
	</body>
</html>