Calendar Control and postbacks

  • Thread starter Thread starter MattB
  • Start date Start date
M

MattB

Hi. I posted yesterday about being able to get to Day.IsSelecteable from
outside the calendar's DayRender event. I never figured that out, so I
found another way to do what I needed by externalizing the logic that
sets the calendar days as selectable or not and using that same logic
elsewhere. I thought I had the problem solved, but I noticed something
unexpected.

When I change the selected date in the calendar by clicking on it, my
logic fires to see if the selected date is valid, but the date returned
by Calendar.SelectedDate is the one that was selected before I clicked
on it, not the date I clicked on. This is not what I was expecting.
Anyone know how to get around that? I want to know the date being
clicked on, not the previously selected one.

Thanks!

Matt
 
What event are you using to check the SelectedDate? Page_Load? The
Calendar object's SelectionChanged event? The SelectionChanged event
is the best choice.
 
Back
Top