Posted on 2004-03-31
I have a function that is called from the end of Page_Load() that attempts to initialize the currently-selected date of several Calendar controls.
However, no matter how I try to initialize these Calendars, every time they come up with the current month (March 2004).
What's wrong with what I'm doing here?
'// This code is always executed, but the calendar always displays with the current month.
If (Not (dtCreationDate = Nothing)) Then
'// At this point, dtCreationDate = #6/21/2001#
sDateFormat = "yyyy/MM/dd"
Me.calendarCreationDate.SelectedDate = dtCreationDate.ToString(sDateFormat)
I've tried it just using the DateTime variable, too:
Me.calendarCreationDate.SelectedDate = dtCreationDate
to no avail.
What do I have to do here to initialize this stupid control?