Calendar1.SelectedDate 只返回 {0001-1-1 0:00:00}
阿嚏个技术 2008-09-09 01:52:22 日历显示正常,但点击日历上的日期后,selecteddate返回的0001-1-1 0:00:00,请问是什么原因??
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
date1 = DateTime.Now;
}
else
date1 = this.Calendar1.SelectedDate;
}
aspx文件
<body>
<form id="form1" runat="server">
<div>
选择查询日期:<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Height="180px" Width="200px">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</div>
统计数据:<asp:Label ID="Label1" runat="server" Text="0" Width="112px"></asp:Label>
</form>