Calendar: detect when selected day is clicked

  • Thread starter Thread starter Ben Amada
  • Start date Start date
B

Ben Amada

Hi,

I'm using the built-in calendar control. One problem I'm having is that if
the user clicks on the day in the calendar which is already the
SelectedDate, a postback occurs, but the SelectionChanged event doesn't
fire.

Is there anyway to disable the SelectedDate link so the user can't click on
it? Or even better, is there a way to detect whether the same day was
clicked or not? I tried checking the SelectedDate value in the Page_Load
event, but in the Page_Load event the SelectedDate value hasn't been updated
yet to the date that was clicked on -- so I can't determine whether the same
day was clicked on or a different day was clicked on.

Thanks in advance for any help!
Ben
 
Ben said:
Or even better, is there a way to detect whether the same day was
clicked or not? I tried checking the SelectedDate value in the Page_Load
event, but in the Page_Load event the SelectedDate value hasn't been
updated yet to the date that was clicked on -- so I can't determine
whether the same day was clicked on or a different day was clicked on.

I found that I can check in Page_PreRender whether or not the same day was
clicked or not. Problem fixed...

Thanks,
Ben
 
Back
Top