<%@ Page Language="C#" AutoEventWireup="True" %>
<HTML>
	<head>
		<title>第5章_高级Web控件 在 Calendar Web 服务器控件中控制用户日期选定</title>
	</head>
	<script runat="server">
  
      void Selection_Change(Object sender, EventArgs e)
      {

         // Set the day selection mode.
         Calendar1.SelectionMode = 
            (CalendarSelectionMode)ModeList.SelectedIndex;
      }
  
	</script>
	<body>
		<form runat="server" ID="Form1">
			<h3>
				Calendar控件控制日期选定
			</h3>
			选择日期选定模式
			<br>
			<asp:Calendar id="Calendar1" 
				ShowGridLines="True" 
				ShowTitle="True" 
				runat="server" 
				SelectMonthText="选择月"
				SelectWeekText="选择周" />
			<br>
			<br>
			<table cellpadding="5">
				<TBODY>
					<tr>
						<td>
							请选择：
						</td>
					</tr>
					<tr>
						<td>
							<asp:DropDownList 
								id="ModeList" 
								AutoPostBack="True" 
								OnSelectedIndexChanged="Selection_Change" 
								runat="server">
								<asp:ListItem> None </asp:ListItem>
								<asp:ListItem Selected="True"> Day </asp:ListItem>
								<asp:ListItem> DayWeek </asp:ListItem>
								<asp:ListItem> DayWeekMonth </asp:ListItem>
							</asp:DropDownList>
						</td>
					</tr>
				</TBODY>
			</table>
		</form>
		</TBODY>
	</body>
</HTML>
