Programmatically change calendar control date

I have a page where a user enters a date and clicks enter. The date is assigned to a variable:
dtSelectedDate has the value "4/12/2009"
Me.Calendar1.SelectedDate = dtSelectedDate  

I want to change the calendar control to that date. The date is highlighted but the calendar control is on the wrong month and year. I have to scroll to the right month and year manually where the proper date is highlighted.

How do I get the calendar to programmatically select the proper month and year?
bertino12Asked:
Who is Participating?
 
TSmoothConnect With a Mentor Commented:
You need to also set the calendar's "VisibleDate" property to that date.
0
 
j-w-thomasCommented:
What kind of control is the Calendar1 ? Is it an actual ASP calendar control?

just clarifying
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.