How do you set the date on a calendar control?

  • Thread starter Thread starter MichaelJohnson168
  • Start date Start date
M

MichaelJohnson168

I am using visual basic code and I have a calendar control on a page.
The name of the calendar control is Calendar1.


When the page loads, I am wanting to set the date on the Calendar, for
example April 4, 2009. Both code lines that I used below do not
display the dates wanted, but rather the current date.


Calendar1.SelectedDate = New Date(2009, 4, 15)

Calendar1.SelectedDate = New DateTime(2009, 4, 15, 0, 0, 0)


Does anyone have knowledge on how I can set the dates on the calendar?
 
I am using visual basic code and I have a calendar control on a page.
The name of the calendar control is Calendar1.


When the page loads, I am wanting to set the date on the Calendar, for
example April 4, 2009. Both code lines that I used below do not
display the dates wanted, but rather the current date.


Calendar1.SelectedDate = New Date(2009, 4, 15)

Calendar1.SelectedDate = New DateTime(2009, 4, 15, 0, 0, 0)


Does anyone have knowledge on how I can set the dates on the calendar?

Try setting the VisibleDate to the same date as the selected date.
 
Back
Top