[求助]程序出错问题!
<script language="C#" runat="server">protected void Date_Selected(object sender,EventArgs e)
{
switch (Calendar1.SelectedDates.Count)
{
case(0):
{
Label1.Text="您选择日期";
break;
}
case(1):
{
Label1.Text="您选择的日期是: "+Calendar1.SelectedDate.ToShortDateString();
break;
}
case(7):
{
Label1.Text="您的选择是一周的开始: "+Calendar1.SelectedDate.ToShortDateString();
break;
}
default:
Label1.Text="您的选择是一个月的开始: "+ Calendar1.SelectedDate.ToShortDateString();
break;
}
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<TABLE height="720" cellSpacing="0" cellPadding="0" width="262" border="0" ms_2d_layout="TRUE">
<TR vAlign="top">
<TD width="262" height="720">
<form id="Form1" method="post" runat="server">
<TABLE height="245" cellSpacing="0" cellPadding="0" width="708" border="0" ms_2d_layout="TRUE">
<TR vAlign="top">
<TD width="10" height="15"></TD>
<TD width="698"></TD>
</TR>
<TR vAlign="top">
<TD height="41"></TD>
<TD>
<h3>Calendar控件演示</h3>
</TD>
</TR>
<TR vAlign="top">
<TD height="169"></TD>
<TD>
<asp:Calendar ID="Calendar1" OnSelectionChanged="Date_Selected" SelectionMode="DayWeekMonth" Font-Name="Verdana"
Font-Size="12px" NextPrevFormat="ShortMonth" SelectWeekText="week" SelectMonthText="month"
runat="server">
<TodayDayStyle Font-Bold="True" ForeColor=#ff0066 />
<DayHeaderStyle Font-Overline=True Font-Bold="True" />
<OtherMonthDayStyle ForeColor="gray" />
<TitleStyle BackColor="#3366ff" ForeColor="White" Font-Bold="True" />
<SelectedDayStyle ForeColor=#006600 BackColor="#ffcc66" Font-Bold="True" />
<NextPrevStyle ForeColor=#ff0099 Font-Size="10px" />
<SelectorStyle BackColor="#99ccff" ForeColor=#ffcc33 Font-Size="9px" />
</asp:Calendar></TD>
</TR>
<TR vAlign="top">
<TD height="20"></TD>
<TD>
<h4><asp:Label ID="Label1" Runat="server" /></h4>
</TD>
</TR>
</TABLE>
</form>
</TD>
</TR>
</TABLE>
</body>
</HTML>