ASP.Net Calendar Control - selectedDate doesn't auto focus
Posted on 2011-02-14
I have 2 calendar controls, and have this code in Page_Load
calFrom.SelectedDate = DateTime.Today.AddDays(-30);
calTo.SelectedDate = DateTime.Today;
The problem I have now, is that the From calendar control doens't auto focus on the month that I want. So the selected date of today - 30 (15th January), yet the page displays February without any date selected (unless I click previous month)
What code is needed to set the auto month focus to be that of the selected date ?