Reputation: 54167
I am using the standard asp:Calendar
control. When a user clicks a date, I am showing a modal popup by handling the SelectionChanged
event.
However this means that nothing happens if the user clicks a date, then closes the popup, then clicks the same date again.
I'd rather be handling a DateClick
event, and do away with the concept of having a selected date altogether.
Can this be achieved using the asp:Calendar
?
Upvotes: 2
Views: 6585
Reputation: 177
I had a similar problem - I solved it by preventing the user from selecting the currently selected date. I put the following in the DayRender
event:
If e.Day.Date = DateValue(calCalendar.SelectedDate) Then
e.Day.IsSelectable = False
End If
Upvotes: 3
Reputation: 54167
Found a workaround:
In the SelectionChanged
event handler, just call
calendar.SelectedDates.Clear();
Upvotes: 4