PDA

View Full Version : Selecting multiple multiple date not working


chelvis
06-14-2006, 04:59 PM
I have a form with a calendar control (calSource) and a label (lblDate). When I select a single date it displays the date I selected. But when I tried to select multiple dates (select one date + shift + another date), it is displaying page cannot be displayed and in the address bar it displays this: javascript:__doPostBack('calSource','2365')

Can some one please explain this to me?

Here is the code:



private void calSource_SelectionChanged(object sender, System.EventArgs e)
{
//Display the current date
lblDate.Text = "Current Date is: " + calSource.TodaysDate;
if (calSource.SelectedDates.Count == 1)
//if one date is selected, display it
lblDate.Text = "Selected date: " + calSource.SelectedDate;
else
//if multiple dates are selected display them
lblDate.Text = "Selected dates: " + calSource.SelectedDates[0] + " to " + calSource.SelectedDates[calSource.SelectedDates.Count - 1];
}