Calendar Control and postbacks

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
 
S

Scott Allen

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top