我一直在做一个项目,但遇到了一个问题,即我可以使用 asp.net 日历控件选择第一个和最后一个日期,但我希望使用日历扩展器来完成
如下所示的代码用于日历控制..请为我提供所需修改的日历扩展器的解决方案........
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
Calendar1.SelectionMode = CalendarSelectionMode.DayWeek;
//ArrayList selectedDates = new ArrayList();
string s = Calendar1.SelectedDate.ToShortDateString();
DateTime today = DateTime.Parse(s);
DateTime firstDay = today.AddDays(-(double)(today.DayOfWeek));
DateTime lastDay = today.AddDays(6 - (double)(today.DayOfWeek));
for (int loop = 0; loop < 7; loop++)
Calendar1.SelectedDates.Add(firstDay.AddDays(loop));
lblStartOfWeek.Text = firstDay.ToLongDateString();
lblEndOfWeek.Text = lastDay.ToLongDateString();
lblStartOfWeek.Visible = true;
lblEndOfWeek.Visible = true;
checkLessonPlan();
}