Solved

Programmatically change calendar control date

Posted on 2007-11-29
2
544 Views
Last Modified: 2012-06-21
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?
0
Comment
Question by:bertino12
2 Comments
 
LVL 3

Expert Comment

by:j-w-thomas
ID: 20374051
What kind of control is the Calendar1 ? Is it an actual ASP calendar control?

just clarifying
0
 
LVL 16

Accepted Solution

by:
TSmooth earned 500 total points
ID: 20374054
You need to also set the calendar's "VisibleDate" property to that date.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question