How do you set the date on a calendar control?

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?
 
F

Family Tree Mike

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.
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top