Jim,
You need to set the VisibleDate property of the Calendar as well as the SelectedDate property.
>Hi Cathi,
>
> Thanks for pointing that out... I changed the code and it still doesn't work. What I have now is below...
>
>MyCalendar.SelectedDate = Convert.ToDateTime(MyCalendar.VisibleDate.Month.ToString() + "/" + MyCalendar.VisibleDate.Day.ToString() + "/" + cboYear.Items(cboYear.SelectedIndex).ToString())
>
>>Real quickly looking at this code, I see that you are getting the reference to the SelectedIndex of the cboMonth combobox. Shouldn't this be from the SelectedIndex of the cboYear combobox?
>>
>>>Hello,
>>>
>>> I have created a ASPX page with a calendar control on it. I added to the page two combo boxes, one for the year and one for the month. I did this because I didn't find a way to have the user select the year or month without clicking a bunch of times. Anyway, I am having trouble finding a way to change the year of the calendar. The code from the year combo box is below. The selected value is 2002 all the time for some reason.
>>>
>>>What's wrong with the code below? Is there a better way accomplish this?
>>>
>>>MyCalendar.SelectedDate = Convert.ToDateTime(MyCalendar.VisibleDate.Month.ToString() + "/" + MyCalendar.VisibleDate.Day.ToString() + "/" + cboYear.Items(cboMonth.SelectedIndex).ToString())
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi