Setting a calendar's selected date
-
This seems like something that should be easy but it just is not working. What I want to do is set the selected date of a calendar control programatically on the page load. I tried this and it did'nt work:
myCalendar.SelectedDate = myDate myCalendar.VisibleDate = myDate
The visible date is changed and the correct month is shown but the selected date is not highlighted like it is after you click on a date. Any suggestions on what the problem is? myDate is simply a date object. Thanks in advance. -
This seems like something that should be easy but it just is not working. What I want to do is set the selected date of a calendar control programatically on the page load. I tried this and it did'nt work:
myCalendar.SelectedDate = myDate myCalendar.VisibleDate = myDate
The visible date is changed and the correct month is shown but the selected date is not highlighted like it is after you click on a date. Any suggestions on what the problem is? myDate is simply a date object. Thanks in advance. -
Date.Now doesn't work but Date.Today does, the only difference is that date.today doesn't have hours, minutes and seconds. Now my date object does so I'm assuming that's the problem! Any idea's on how to force my date object into that format?