我怀疑如何在asp.net日历控件中选择日期范围 例如,我将给出开始日期和结束日期,以便选择这些日期之间的所有日期。
有人可以帮我吗
答案 0 :(得分:0)
这是链接中的示例...
// Iterate through the current month and add all Wednesdays to the
// SelectedDates collection of the Calendar control.
for (int i = 1; i <= System.DateTime.DaysInMonth(current_year, current_month); i++)
{
DateTime currentDate = new DateTime(current_year, current_month, i);
if (currentDate.DayOfWeek == DayOfWeek.Wednesday)
{
DisplayCalendar.SelectedDates.Add(currentDate);
}
}