Solved

Programmatically change calendar control date

Posted on 2007-11-29
2
542 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now