I am trying to set a calendar server control (in visual studio) to a custom month and year that is selected by a user using a drop down list for months and one for years. I have it so that the calendar does not appear until both month and year are selected from the drop down. I am not sure where to go now so that when the calendar appears, it is set to the month and year selected, allowing the user to select the day they were born from the calendar once it appears. I am using C# for my code behind. Here is my code behind code for my page:
protected void DropDownListYear_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownListMonth.SelectedIndex != 0)
{
CalendarBday.Visible = true;
CalendarBday.SelectMonthText = DropDownListMonth.Text;
}
}
protected void DropDownListMonth_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownListYear.SelectedIndex != 0)
{
CalendarBday.Visible = true;
}
}